A few days ago I succeeded both with building Octave with built-in java
support on MinGW and cross-compiling it (MXE) on my Linux box.
Cross-compiling is as follows: (beware it's a bit of a kludge just meant as
a proof-of-concept)
1. Patch configure.ac to add "-Wl,--export-all-symbols" to the load flags in
the mingw section (bug# 39454). This is required for any mingw Octave build.
(There's some discussion whether this is the best fix - for including core
Java support it is OK but other MinGW packages may need another place for
this fix.)
2. Make sure the platform-dependent jni_md.h can be found.
## Kludge warning:
## I copied<Windows><jdk>/include/win32/ subdir + contents over to my
## Linux<jdk>/include subdir.
## I also did a "touch jvm.dll" somewhere (actually in
##<Linux_JDK>/jre/lib/i386/client) to comfort configure that
## complained it couldn't find jvm.dll.
## (I think this is a bug in configure)
Add the following in<mxe-octave>/src/octave.mk in the configure section:
--with-java-includedir=</full/path/to/linux/jdk> ## Omit include/ subdir
in this path!
--with-java-libdir=</full/path/to/some/place/with/dummy/jvm.dll>
(maybe on MingW/native build:)
--with-java-homedir=</full/path/to/jdk> ## Not sure if this is needed
(3. If you want the latest dev version, build a "make all dist"
octave-<version>.tar.gz, copy it over to<mxe-octave>/pkg, do "openssl sha1
octave-<version>.tar.gz" and substitute the checksum in
<mxe-octave>/src/octave.mk)
4. Run ./mk-dist<options>
When cross-compiling on Linux Octave's configure will probably find the
javac and jar executables from the build platform.
When building on MinGW, JAVA_HOME should be set properly.
Things to improve:
A. Find out if we could just dld/copy the contents of<jdk>/include&
<jdk>/include/win32, or download them from theURLs Michael gave above, and
point --with-java-includedir= to it.