0

I am running OS X Yosemite. I add Java to my path in .bashrc like this:

export JAVA_HOME=$(/usr/libexec/java_home -v 1.8) 
export PATH=$JAVA_HOME/bin:$PATH 

/user/libexec/java_home -v 1.8 points me to /Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home.

This sets my "default" JDK to be 1.8.0_74. I'm not sure where this JDK came from. I think it shipped with Yosemite.

Separately, Java Updater runs periodically and updates Java. Currently it says I am on 1.8.0_161:

enter image description here

But I can't find it on my computer anywhere! It's not inside /Library/Java/JavaVirtualMachines/. I tried find / -name java -type f and still couldn't find it. Where is it?

5
  • Does pkgutil --pkgs | egrep -i 'oracle|java|jdk|jre' show any relevant packages installed?
    – thrig
    Feb 3, 2018 at 22:36
  • I did not know pkgutil existed. The output is (sorry all one line): com.apple.pkg.JavaEssentials com.apple.pkg.JavaForMacOSX107 com.apple.pkg.JavaMDNS com.apple.pkg.JavaSecurity com.apple.pkg.JavaTools com.oracle.jdk7u67 com.oracle.jdk8u25 com.oracle.jdk8u74 com.oracle.jre Feb 3, 2018 at 22:39
  • com.oracle.jdk7u67 com.oracle.jdk8u25 com.oracle.jdk8u74 are the ones in /Library/Java/JavaVirtualMachines/ Feb 3, 2018 at 22:39
  • Looks like running it with --files against com.oracle.jre shows some files that suggest it's 1.8.0_161 (the desired version), and running it with | grep bin shows java exists in Contents/Home/bin/java. Trying to figure out where that is. Feb 3, 2018 at 22:43
  • Survey says: apple.stackexchange.com/a/31588/12843 (the root of the installation is /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/) Feb 3, 2018 at 22:46

1 Answer 1

1

If you just install the JRE it goes in /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/

If you install the JDK it goes in /Library/Java/JavaVirtualMachines/

The JRE is not much use for general Java usage as it is only available in browsers. You need the JDK to run normal Java programs or things like Eclipse.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .