It's fairly complicated. This is how the launcher running inside
asadmin chooses a JVM to run.
In order of precedence from high to low:
(1) the jdk location specified in domain.xml in the java-config
("java-home")
(2) asenv property file (in glassfish/config)
(3) whatever the env. variable, JAVA_HOME, is pointing at
(4) The java.home system property is used like so:
(4A) Parent directory of java.home -- this is because sometimes the
JRE's java is asadmin's JVM and the JDK may be in the directory above.
(4B) contents of java.home
In every case I *guarantee* a valid java. E.g. you can set 1,2,3 to
garbage and we'll still find a java to use.
Note that we NEVER explicitly use java from the path -- if there is one.
p.s. If you are wondering where the code is -- 90% of it is inside
AsenvPropertyReader.java
10% is in GFLauncher.java
-- AsenvPropertyReader can't access domain.xml. GFLauncher *can*. His
job is to see if (1) above applies. If not he defers to
AsenvPropertyReader.
Clear?
On 6/22/2011 12:25 PM, Lidia Marchioni wrote:
> Hi all
>
> Could someone please let me know how we pick up java in Glassfish
> 3.1.1? This is in case AS_JAVA_HOME is not defined in asenv.conf
> file. We are seeing an odd issue with Admin Console sometimes not
> coming up on AIX systems
> (http://java.net/jira/browse/GLASSFISH-16890). Do we check JAVA_HOME,
> PATH anything else?
>
> Thanks
> Lidia
--
Oracle <http://www.oracle.com>
Byron Nevins | Principal MTS
Phone: +1 6503958992 <tel:+1%206503958992>
Green Oracle <http://www.oracle.com/commitment> Oracle is committed to
developing practices and products that help protect the environment