Last Updated: November 21, 2017
· paolodt

Get the list of all JVM on your Mac

You may have noticed many different paths for the JVM on your Mac:

/System/Library/Java/JavaVirtualMachines is the path where Apple install the system JVM. Here you could have only one JVM by family, i.e. 1.6, 1.7. These JVM will be available to all users.

/Library/Java/JavaVirtualMachines is a slot location for guest JVMs, specially designed to host contributors JVM like Oracle, openjdk-osx-build, etc. Also, these JVMs will be available to all the users.

/Users/bill/Library/Java/JavaVirtualMachines is a slot for contributor JVMs but only available to user bill.

OSX comes with an handy cli tool to find out which is the current Java installation home path. Just type the following command on your terminal shell:

$ /usr/libexec/java_home

It prints the home path of your JVM. Even more interestingly specifying the option -V, it shows the list of all the JVMs installed on your system along their home path.

This nice tool has other useful options, like filtering the JVM by version or architecture, etc. Run java_home --help for the list of available options.

Read more here: