octave-maintainers
[Top][All Lists]
Advanced

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

Re: Java compilation warnings


From: Michael D. Godfrey
Subject: Re: Java compilation warnings
Date: Fri, 07 Dec 2012 11:31:21 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0

On 12/07/2012 11:20 AM, Philip Nienhuis wrote:
On Linux, you need a Java JDK and a proper JAVA_HOME setting.
The Java executables javac (Java compiler) and jar (Java archiver) are
probably symlinked in /usr/bin/
On MinGW this isn't the case so the subdir containing jar.exe and javac.exe
needs to be in the PATH. If 'javac --version' doesn't work for you you'd
rather follow MinGW, or create the symlinks yourself.

When Java was still an octave-forge package, a proper JAVA_HOME setting was
simply essential.
Perhaps the logic in this former java-package preinstall.m may enlighten
you:
http://sourceforge.net/p/octave/code/11449/tree/trunk/octave-forge/extra/java/pre_install.m

According to an old post by Michael Goffioul in the OctDev ML, JAVA_HOME
should be set such that (in the end, after following all symlinks):
  <JAVA_HOME>/jre/lib/<arch>/client/
contains the JVM (libjvm.so).
In the meantime on 64bit systems the JVM is often found in 
  <JAVA_HOME>/jre/lib/<arch>/server/

The attempts in the autotools to discover JAVA_HOME just don't work that
well at the moment.
Perhaps following the symlinks starting from /usr/bin/javac might help on
Linux (if javac is symlinked to from /usr/bin, that is).
On MinGW I'm afraid setting JAVA_HOME by hand will be unavoidable, as the
JDK can only be found by quite involved trial and error (and some luck).
I got reports from a Fink developer telling me that on Mac OSX the JDK
location might change with every new OSX version and the JDK is no more
comprehensive but scattered all over the place. The Apple tool 'javaconfig'
is needed to find out what parts are where.

Philip

In my case (fc17):

./configure set JAVA_HOME to '/usr/lib/jvm'.  This may not have been a good
choice.  However, with that setting everything else in the build worked OK.

If you have another suggestion for JAVA_HOME I could try it.  I did try some
likely values a few weeks ago, but did not find a complete solution.  The rate
of change then was pretty high so I have waited a bit.

Michael


reply via email to

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