Enabled Java in native MinGW but yet to add full support

Since my last update, I have been working only on natively compiling mxe-octave in MinGW/MSYS environment. My mentor Michael Goffioul had advised me to enable more features in my build like LLVM/JIT and Java. But including Java in my cross build was a pain. I was interrupted by missing DLL files (jvm.dll) which do not happen to exist in OpenJDK on Linux. Unwillingly enough, I had to try using the Java installation present in Windows while still cross compiling from Linux. This I had achieved by specifying in the configure options to search for the Java SDK installed inside Windows. Philip Nienhuis had previously tried the same thing using a symlink trick but his work was also interrupted by similar errors. To sum up, I couldn’t get Java enabled in cross-builds which forced me to switch to native builds in MinGW. I will probably continue my work on native builds.

I am specifying the configuration details related to Java libraries from mxe-octave/log/octave.txt. It might be useful for those who are trying to get Java support in native builds.


checking for java... /c/Java/jdk1.7.0_25/jre/bin/java
checking for javac... /c/Java/jdk1.7.0_25/bin/javac
checking for jar... /c/Java/jdk1.7.0_25/bin/jar
checking for Java version... 1.7.0_25
checking for jvm.dll... c:\Java\jdk1.7.0_25\jre\bin/client
checking for include file <jni.h>... /c/Java/jdk1.7.0_25/include


Java home: /c/Java/jdk1.7.0_25
Java JVM path: c:\Java\jdk1.7.0_25\jre\bin/client
Java CPPFLAGS: -I/c/Java/jdk1.7.0_25/include -I/c/Java/jdk1.7.0_25/include/win32
Java libraries: -ladvapi32

The configure options I used:
--with-java-homedir="/c/Java/jdk1.7.0_25"
--with-java-includedir="/c/Java/jdk1.7.0_25"

If configure options are specified then it overrides environment variables. Still I am mentioning it:
JAVA_HOME="/c/Java"

So the details of my current build are as follows:

Build Octave GUI: yes
JIT compiler for loops: no
Build Java interface: yes
Do internal array bounds checking: no
Use octave_allocator: no
Build static libraries: no
Build shared libraries: yes
Dynamic Linking: yes (LoadLibrary)
Include support for GNU readline: yes
64-bit array dims and indexing: no

Java support is yet to be actually added in my build. I am facing the same problem which Philips has reported here.

In my build I also have Ghostscript included (in pstoedit package). I had experienced an issue which you can see here. If anyone else is experiencing this, you can either add ac_cv_path_GS="/c/gs/gs9.07/bin' to the configure options (like I did), or more simply rename your file gswin32.exe to gs.exe (See #36076 in Octave bug tracker).

Since I couldn’t launch Octave GUI on my Windows 8 (there seems to be a problem specific to Windows 8), I asked a friend of mine to test my Octave build who was kind enough to send me screenshots of the GUI.

Leave a comment