https://issues.apache.org/bugzilla/show_bug.cgi?id=54390

--- Comment #2 from Nick Williams <nicho...@nicholaswilliams.net> ---
IIRC, the correct and "official" (whatever that means) way of determining the
JDK that has been set up as the default on Mac OS X is to run the command
/usr/libexec/java_home. For example, on a system running Apple Java 6 and Java
7 OpenJDK and with Java 7 set as the default, I get this:

$ /usr/libexec/java_home
/Library/Java/JavaVirtualMachines/jdk1.7.0_07.jdk/Contents/Home
$ `/usr/libexec/java_home`/bin/java -version
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) 64-bit Server VM (build 23.3-b01, mixed mode)

On a system with only Apple Java 6 instealled, I get this:

$ /usr/libexec/java_home
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
$ `/usr/libexec/java_home`/bin/java -version
java version "1.6.0_33"
Java(TM) SE Runtime Environment (build 1.6.0_33-b03-424-10M3720)
Java HotSpot(TM) 64-bit Server VM (build 20.8-b03-424, mixed mode)

It took me a long time (hours) once upon a time to figure out how to correctly
determine the default Java on Mac OS X, and this appears to be it. It would
seem to me that, on Mac OS X, Tomcat should utilize the /usr/libexec/java_home
command to determine JAVA_HOME when JAVA_HOME is not previously set. Just my
$0.02.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to