octave-maintainers
[Top][All Lists]
Advanced

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

Re: Java jni.h


From: Rik
Subject: Re: Java jni.h
Date: Fri, 07 Dec 2012 11:36:39 -0800

On 12/07/2012 11:10 AM, Michael D. Godfrey wrote:
> On 12/07/2012 02:05 PM, Rik wrote:
>> Try setting JAVA_HOME to /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64.
> I will try that, but of course it will break the next time java is updated,
> Is there a more persistent way
Probably.  It's just going to take a while because this is so complicated.

One thing to do would be to do an all out search for a Java run-time
environment.  If we could at least find that then we could use the
following Java code to find JAVA_HOME.

public class JavaHomeDirectory {
    public static void main(String[] args) {
        String javaHome = System.getProperty("java.home");
        System.out.println("javaHome = " + javaHome);
    }
}

This would mean compiling this code snippet into byte code and adding it to
the build system so that it was always available.

If you want to test that it works for you, put the code in
JavaHomeDirectory.java and then run

javac JavaHomeDirectory.java
java JavaHomeDirectory

It should hopefully point to
/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64/jre/bin.

--Rik


reply via email to

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