See all the Java versions installed on Mac

Java

Java Problem Overview


How can I get all the Java versions installed on my Mac?

Is there a terminal command for this?

When I run java -version, I get the current JRE version that is in use in my system, but I want to list all the JREs installed on my Mac.

Java Solutions


Solution 1 - Java

/usr/libexec/java_home -V

lists one line per Java environment installed (and known to the /usr/bin/java command).

You can still have other Java distributions which are not registered. They are typically downloaded as ZIP files without an installer.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questioneureka19View Question on Stackoverflow
Solution 1 - JavaThorbjørn Ravn AndersenView Answer on Stackoverflow