macOS: Find Java Installation Path
by admin on Aug.27, 2018, under MAC OS X
I recently was trying to figure out where Java is being installed on macOS. One may use the following command to find the Java Home Directory of the java currently in path.
echo $(/usr/libexec/java_home)
Per default, the Java Home directory for JDK’s on macOS is:
/Library/Java/JavaVirtualMachines/jdk.jdk/Contents/Home/
For example:
/Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home/
And analogous for JRE’s:
/Library/Java/JavaVirtualMachines/jdk.jre/Contents/Home/