Java utility for mac

broken image
broken image

This will print out the current Java version installed on your Mac computer. Save the file by tapping on ESC button on the keyboard and then :wq. This will save the file and will quite.The /usr/libexec/java_home will return the current version of Java installed on the Mac computer. profile file for editing.Įxport JAVA_HOME=$(/usr/libexec/java_home)

broken image

I will use the vi text editor on Mac but you can use the text editor of your choice. To set the JAVA_HOME environment variable for a current user you will need to update the ~/.profile file. To print the current Java version installed, simply use java -version Set JAVA_HOME Environment Variable If you have more than one version installed and you want to see all of the versions available, then run the following command in the terminal window. For example, open the terminal window on your Mac and type the following command to print out the top Java version installed on your Mac /usr/libexec/java_home Starting from Mac OS 10.5 there is a very convenient command that we can use to identify the installed Java version. The new way of setting JAVA_HOME environment variable allows us to dynamically identify and use the current Java version installed on a computer as well as let us switch between Java versions if there is more than one installed. In this tutorial, I am going to share with you how to set the JAVA_HOME environment variable on a new MAC.