To list all of the installed versions of Java on your Mac, you can use the /usr/libexec/java_home
command in a terminal.
To open a terminal on your Mac, go to the Applications folder, then the Utilities folder, and double-click on Terminal. Alternatively, you can use the Spotlight
search feature to find the Terminal app.
Once the terminal is open, type the following command and press Enter
:
/usr/libexec/java_home -V
This will print a list of all of the installed Java versions, along with their corresponding locations.
If you want to see the version of Java that is currently being used by the system, you can use the java -version
command.