Where does Oracle (Sun) install their JDK/JRE on Mac OS X 10.8 Mountain Lion?
On my system, evaluating which java
leads me to /usr/bin/java
. This in turn is a symlink to:
/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java
In case it's relevant, java -version
tells me I have 1.6.0_37
installed.
The version 8 release from Oracle (1.8.0_40-b25) can be found at:
/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/bin/java
FYI: Oracle is not following the practice of making /Library/Java/Current (etc) a link to the latest installed java.
Below is my method of keeping up with versions over time: from my .zshrc file:
108 JAVA_6_HOME=/System/Library/Frameworks/JavaVM.framework/Home
109 JAVA_7_HOME=/Library/Java/Current
110 JAVA_8_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home
111
112 export JAVA_6_HOME
113 export JAVA_7_HOME
114 export JAVA_8_HOME
115
116 export JAVA_HOME=$JAVA_8_HOME
117
118 PATH=$PATH:$JAVA_HOME/bin
119