Mercurial > hg > octave-lyh
annotate build-aux/OctJavaQry.java @ 15763:56239ff815a3
build: Overhaul auto-detection of Java when JAVA_HOME is not set.
* build-aux/OctJavaQry.class: Compiled code to help configure determine
installation directories. Exported in tarball.
* build-aux/OctJavaQry.java: Java code to help configure determine
installation directories.
* Makefile.am: Export OctJavaQry.class code in tarball.
* configure.ac: If JAVA_HOME is unset, attempt to find a Java executable.
Use java executable and Java code to try and determine necessary directories.
* libinterp/octave-value/ov-java.cc: Use JAVA_LDPATH variable to find libjvm.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 10 Dec 2012 13:15:08 -0800 |
parents | |
children | fafd51a1b0f0 |
rev | line source |
---|---|
15763
56239ff815a3
build: Overhaul auto-detection of Java when JAVA_HOME is not set.
Rik <rik@octave.org>
parents:
diff
changeset
|
1 // Code used by configure script to locate Java installation variables. |
56239ff815a3
build: Overhaul auto-detection of Java when JAVA_HOME is not set.
Rik <rik@octave.org>
parents:
diff
changeset
|
2 // Only compiled code, OctJavaQry.class, is distributed. |
56239ff815a3
build: Overhaul auto-detection of Java when JAVA_HOME is not set.
Rik <rik@octave.org>
parents:
diff
changeset
|
3 public class OctJavaQry |
56239ff815a3
build: Overhaul auto-detection of Java when JAVA_HOME is not set.
Rik <rik@octave.org>
parents:
diff
changeset
|
4 { |
56239ff815a3
build: Overhaul auto-detection of Java when JAVA_HOME is not set.
Rik <rik@octave.org>
parents:
diff
changeset
|
5 public static void main (String[] args) |
56239ff815a3
build: Overhaul auto-detection of Java when JAVA_HOME is not set.
Rik <rik@octave.org>
parents:
diff
changeset
|
6 { |
56239ff815a3
build: Overhaul auto-detection of Java when JAVA_HOME is not set.
Rik <rik@octave.org>
parents:
diff
changeset
|
7 if (args.length > 0) |
56239ff815a3
build: Overhaul auto-detection of Java when JAVA_HOME is not set.
Rik <rik@octave.org>
parents:
diff
changeset
|
8 { |
56239ff815a3
build: Overhaul auto-detection of Java when JAVA_HOME is not set.
Rik <rik@octave.org>
parents:
diff
changeset
|
9 if (args[0].equals ("JAVA_HOME")) |
56239ff815a3
build: Overhaul auto-detection of Java when JAVA_HOME is not set.
Rik <rik@octave.org>
parents:
diff
changeset
|
10 { |
56239ff815a3
build: Overhaul auto-detection of Java when JAVA_HOME is not set.
Rik <rik@octave.org>
parents:
diff
changeset
|
11 System.out.println (System.getProperty ("java.home")); |
56239ff815a3
build: Overhaul auto-detection of Java when JAVA_HOME is not set.
Rik <rik@octave.org>
parents:
diff
changeset
|
12 } |
56239ff815a3
build: Overhaul auto-detection of Java when JAVA_HOME is not set.
Rik <rik@octave.org>
parents:
diff
changeset
|
13 else if (args[0].equals ("JAVA_LDPATH")) |
56239ff815a3
build: Overhaul auto-detection of Java when JAVA_HOME is not set.
Rik <rik@octave.org>
parents:
diff
changeset
|
14 { |
56239ff815a3
build: Overhaul auto-detection of Java when JAVA_HOME is not set.
Rik <rik@octave.org>
parents:
diff
changeset
|
15 System.out.println (System.getProperty ("java.library.path")); |
56239ff815a3
build: Overhaul auto-detection of Java when JAVA_HOME is not set.
Rik <rik@octave.org>
parents:
diff
changeset
|
16 } |
56239ff815a3
build: Overhaul auto-detection of Java when JAVA_HOME is not set.
Rik <rik@octave.org>
parents:
diff
changeset
|
17 } |
56239ff815a3
build: Overhaul auto-detection of Java when JAVA_HOME is not set.
Rik <rik@octave.org>
parents:
diff
changeset
|
18 } |
56239ff815a3
build: Overhaul auto-detection of Java when JAVA_HOME is not set.
Rik <rik@octave.org>
parents:
diff
changeset
|
19 } |