In this tutorial, I am going to share with you how to set the JAVA_HOME environment variable on a new MAC. 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.

Microsoft Word 2010 Para Mac Gratis Java Developer Tools For Mac Pipe Flow Wizard Keygen Hisense Usb Drivers Jodi Arias Bikini Download Lagu Aku Dan Bintang Versi Lama Download The Playercorefactory.xml Script Jillian Michaels 30 Day Shred Level 2 Download Avi Converter Acronis True Image 2014 Keygen Softonic. Mac OS X Version 10.6 and below. Use Software Update available on the Apple menu to check that you have the most up-to-date version of Java 6 for your Mac. Java 7 and later versions are not supported by these older versions of Mac OS X. If you have problems with Java 6, contact Apple Technical Support.

Mac

Starting from Mac OS 10.5 there is a very convenient command that we can use to identify the installed Java version. 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

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.

To print the current Java version installed, simply use

Set JAVA_HOME Environment Variable

To set the JAVA_HOME environment variable for a current user you will need to update the ~/.profile file. I will use the vi text editor on Mac but you can use the text editor of your choice.

  1. Open the terminal windows and type:

    This will open the .profile file for editing.

  2. Add the following line

    The /usr/libexec/java_home will return the current version of Java installed on the Mac computer.

  3. Save the file by tapping on ESC button on the keyboard and then :wq. This will save the file and will quite.
  4. In the terminal window type

    to apply changes to the .profile file right away.

  5. In the terminal window type

    This will print out the current Java version installed on your Mac computer.

Switch Between Java Versions

If you have more than one Java version installed on your computer and you need to switch to using a different version, you can do so by adding the -v <Java Version> flag.

Let’s have a look at a short example.

To learn what Java versions I have installed on my Mac computer I will type the following in the terminal window:

Java

this will return

Which tells that there are two Java versions installed and the top version is “jdk-13.0.1.jdk“.

To set a specific Java version I will need to:

Java Download For Mac

  1. In the terminal window type

    To open the .profile file for editing.

  2. Add Java version I want to set. Like so:

    or if I wanted to set Java version 13, I would do it this way

  3. Save the file by tapping on ESC button on your keyboard and then :wq. This will save the file and will quite.
  4. Apply changes by typing

Java Developer Kit Download Website For Mac

Now if you check Java version by typing

It should print the current Java version set in JAVA_HOME.

Java Developer For Mac Catalina

I hope this tutorial was helpful to you.

Java Developer For MacJava developer kit download for mac

Related Posts:

Powered by Contextual Related Posts