Reputation: 32137
Where does Oracle (Sun) install their JDK/JRE on Mac OS X 10.8 Mountain Lion?
Upvotes: 49
Views: 63729
Reputation: 393
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
Upvotes: -2
Reputation: 31232
Enough answers here, but I'm JUST adding a way to find it by yourself
$ sudo find / -name Java
/Library/Application Support/Oracle/Java
/Library/Java
/private/var/root/Library/Application Support/Oracle/Java
/System/Library/Java
/Users/prayagupd/Library/Application Support/Oracle/Java
To be more specific,
$ sudo find / -name jdk*
/Applications/Android Studio.app/Contents/jre/jdk
/Applications/Android Studio.app/Contents/lib/jdkAnnotations.jar
/Applications/IntelliJ IDEA.app/Contents/jre/jdk
/Applications/IntelliJ IDEA.app/Contents/lib/jdkAnnotations.jar
/Library/Java/JavaVirtualMachines/jdk1.7.0_76.jdk
You see /Library/Java/JavaVirtualMachines/
is the place you need to look inside.
And /Library/Java/JavaVirtualMachines/jdk<version>.jdk/Contents/Home/
is your JAVA_HOME
$ ls -ls /Library/Java/JavaVirtualMachines/jdk1.7.0_76.jdk/Contents/Home/
total 39776
8 -rw-rw-r-- 1 root wheel 3339 Dec 18 2014 COPYRIGHT
8 -rw-rw-r-- 1 root wheel 40 Dec 18 2014 LICENSE
8 -rw-rw-r-- 1 root wheel 114 Dec 18 2014 README.html
216 -rw-rw-r-- 1 root wheel 110114 Dec 17 2014 THIRDPARTYLICENSEREADME-JAVAFX.txt
344 -rw-rw-r-- 1 root wheel 173559 Dec 18 2014 THIRDPARTYLICENSEREADME.txt
0 drwxrwxr-x 44 root wheel 1496 Feb 28 20:13 bin
0 drwxrwxr-x 9 root wheel 306 Feb 28 20:13 db
0 drwxrwxr-x 9 root wheel 306 Feb 28 20:13 include
0 drwxrwxr-x 10 root wheel 340 Feb 28 20:13 jre
0 drwxrwxr-x 14 root wheel 476 Feb 28 20:13 lib
0 drwxrwxr-x 5 root wheel 170 Dec 18 2014 man
8 -rw-rw-r-- 1 root wheel 502 Dec 18 2014 release
39184 -rw-rw-r-- 1 root wheel 20061067 Dec 18 2014 src.zip
Upvotes: 0
Reputation: 41
The JDK/JRE as mentioned in previous answers is located in /Library/Java/JavaVirtualMachines/<version>/Contents/Home/. The JRE is dir under this Home. Interestingly browsers doesn't use files from this location for java applet plugin. The location used by browsers is /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/. In fact if you run JRE installer, it updates the files in this location rather than JDK/JRE location.
Upvotes: 1
Reputation: 11383
Some of the other answers might be correct but this is what worked for me (which is different and up to date as of January 2016) when installing it on a new computer at the office.
The path as mentioned in another answer is
/Library/Java/JavaVirtualMachines/<Replace with version>/Contents/Home
Here however is a visual guide to getting there, because you can find many directories named "Library". Make sure you are here
then click into JavaVirtualMachines
If you are doing a new setup and just downloaded Android studio, they might have sent you to "Download Java for OS X 2015-001" at https://support.apple.com/kb/dl1572?locale=en_US
That gives you version 1.6.0
That won't work!!!!
I got the error that I needed JDK 7.0 or newer.
I looked for a newer version and found this link from Oracle http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
I installed it, then selected that one. And it worked
Upvotes: 8
Reputation: 24039
If you setting the JRE path in something like Eclipse you'll need to point to the /home directory i.e
/Library/Java/JavaVirtualMachines/<Replace with version>/Contents/Home
Upvotes: 9
Reputation: 75187
The Oracle Java SE downloads at: http://www.oracle.com/technetwork/java/javase/overview/index.html
install here on Maverick at least:
/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/
this JRE is entirely separate from the ones that Apple has installed, which are under /System/Library/Frameworks/JavaVM.framework/Versions/
as another answer mentioned.
Upvotes: 14
Reputation: 24447
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.
Upvotes: 7
Reputation: 32137
/Library/Java/JavaVirtualMachines/
according to the Mac JDK Uninstall Docs.
Upvotes: 53