The java_home command with argument -V lists all the Java versions installed on the system and shows the most recent or highest version at the top of the list.
We can also check all the versions of Java installed on the system using the command as shown below.ġ1.0.7, x86_64: 'Java SE 11.0.7' /Library/Java/JavaVirtualMachines/jdk-11.0.7.jdk/Contents/Homeġ.8.0_251, x86_64: 'Java SE 8' /Library/Java/JavaVirtualMachines/jdk1.8.0_251.jdk/Contents/Home We can check the highest version of Java installed on the system using the command as shown below.
Notes: You might be interested in How To Install Java 8 On Mac, How To Install Java 11 On Mac, and How To Uninstall Java From Mac. This tutorial provides the steps required to switch among the multiple versions of Java installed on the same Mac machine. Also, we can assign only one installation to the Java command. We might be required to install multiple versions of Java on the same Mac machine.