octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java support in MXE build


From: Michael Goffioul
Subject: Re: Java support in MXE build
Date: Wed, 15 May 2013 18:50:45 -0400

On Wed, May 15, 2013 at 6:33 PM, John W. Eaton <address@hidden> wrote:
On 05/15/2013 05:55 PM, PhilipNienhuis wrote:
Until now the MXE building process fails to include Java support. Looking at
the log from a freshly checked out MXE build I see:

configure: WARNING: JAVA_HOME environment variable not initialized.
configure: WARNING: Auto-detection will proceed but is unreliable.
checking for java... /usr/bin/java
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/configure: line
66352: pwd: -W: invalid option
pwd: usage: pwd [-LP]
checking for javac... /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19/bin/javac
checking for jar... /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19/bin/jar
checking for Java version... 1.7.0_19
checking for jvm.dll... not found
configure: WARNING: Library jvm.dll not found.  Octave will not be able to
call Java methods.

So the configure script defaults to the Linux Java system on the box where
MXE is run.

I then tried to configure with the Windows Java system, installed on another
(windows 7) partition, by adding a few configure options in
./mxe-octave/src/octave.mk   (symlink /mnt/jhm points to /mnt/win7/Program
Files/Java/jdk1.7.0_21):

:
         JAVA_HOME="/mnt/jhm" \
         --with-java-homedir="/mnt/jhm" \
         --with-java-libdir="/mnt/jhm/jre/bin/server" \

--with-java-includedir="/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19/include" \
:

I had to make the symlink as configure hickups on spaces in path names. This
trick seemed to work, but then I got other errors:

:
- checking for java... /usr/bin/java
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/configure: line
66352: pwd: -W: invalid option
pwd: usage: pwd [-LP]
checking for javac... /usr/bin/javac
checking for jar... /usr/bin/jar
checking for Java version... 1.7.0_19
checking for jvm.dll... /mnt/jhm/jre/bin/server
checking for include file<jni.h>... not found
configure: WARNING: Include file<jni.h>  not found.  Octave will not be able
to call Java methods.
:

Setting JAVA_HOME to the Java installation on the Windows partition doesn't
help in any way.

So it seems the configure script consistently picks up the native (Linux)
Java version and seems to largely ignore the --with-java-* configure
options. It does find the jvm.dll (that configure option works) but not
jni.h while the latter does live in the "java-includedir" indicated in the
configure options.

Obvious question: how can we proceed with getting Java support included in
MXE builds?

I think we need tools like javac and jar that can run on the build system.  We need a jni.h file that can be compiled for MinGW.  And then we need to be able to have a jvm.dll file that can be loaded on the Windows system at run time.  I don't think we really even need to check for that when building.  We just need to be able to locate one that we can use when Octave runs.  So part of the problem is that the configure tests are wrong, and part of it is that we probably don't have the right jni.h on the build system.

I don't know whether it is reasonable to attempt to cross compile our own jvm.dll so that we can distribute one with Octave, or whether we should just expect one to be installed on the Windows system where Octave will run.

I wouldn't distribute our own JVM. Expecting the user to install Java is reasonable IMO.

Michael.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]