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.
Click the 'Java' option. Click 'Java SE.' Click the 'Download' button next to 'JDK 8 with NetBeans.' Select 'Accept License Agreement' and then click the download link for 'Mac OS X' in the top section. This is the most recent release of the Java SDK with the NetBeans development environment. Note: there are various distributions of Java: OpenJDK, Oracle, Amazon Coretta, etc. They all will work with SQL Developer. If the computer has JDK version 1.8 or 1.11, continue on to the install SQL Developer using Self Service section below. If the computer does not have any version of Java, follow the steps to install OpenJDK version 8 below. Java developers may soon be able to get their apps looking less ugly and more Mac-like if a promising new project continues.
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.
- Open the terminal windows and type:
This will open the .profile file for editing.
- Add the following line
The /usr/libexec/java_home will return the current version of Java installed on the Mac computer.
- Save the file by tapping on ESC button on the keyboard and then :wq. This will save the file and will quite.
- In the terminal window type
to apply changes to the .profile file right away.
- 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:
Mac Install Java Developer Kit
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:
- In the terminal window type
To open the .profile file for editing.
- Add Java version I want to set. Like so:
or if I wanted to set Java version 13, I would do it this way
(This feature requires PowerPoint for Microsoft 365 for Mac version 16.22.127.0 or higher.) Set up captions and subtitlesYou can choose which language you want to speak while presenting, and which language the caption/subtitle text should be shown in (i.e. The default setting is Below Slide.More appearance settings are available by clicking Subtitle Settings More Settings (Windows).You can change the color, size, transparency, and font style of the subtitles. Caption it for mac.
- Save the file by tapping on ESC button on your keyboard and then :wq. This will save the file and will quite.
- Apply changes by typing
Now if you check Java version by typing
It should print the current Java version set in JAVA_HOME.
I hope this tutorial was helpful to you.
Related Posts:
Powered by Contextual Related Posts
Java Download For Mac
It comes with a modular structure that’s extensible using plugins, thus letting you work with any type of resource: graphics, video, 3D models, web content, etc. Other languages that can also be used on Eclipse include: C/C , PHP, Ruby, TCL and Javascript.
As a Java IDE it comes with some interesting functions, among them: batch application development, integrated filtering and testing unit, incremental building and compilation, etc.