Install JDK on MacOS

Step 1: Download and Install Oracle Java Development Kit (JDK)

The very first step is to download the Oracle Java Development Kit (JDK) from the Official Oracle Website. For that, Head over to the Official Website.

 

You need to identify your system specifications to choose the Product/file description. The website will contain the latest version for your corresponding system. For Mac, we’ll be downloading the latest x64 DMG Installer of Java SE Development Kit 18. After the download is complete, proceed to install the JDK by following the bootstrapped steps.

 

Step 2: Configure environment variables

Now to configure, we have to open the terminal and pass the following commands. To find the Location of the JAVA_HOME, run this command

$ /usr/libexec/java_home -v{YOUR_VERSION}

 

We have to set this output as our JAVA_HOME Environment Variable. You can use any command or code editor to edit the file, here we are using VS Code

$ code ~/. bash_profile

 

At the very bottom, we have to export the path we obtained earlier i.e. 

$ export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-{YOUR_VERSION}.jdk/Contents/Home

 

Now we have to refresh the environment file by using this command

$ source ~/.bash_profile

And echo the JAVA_HOME variable

$ echo $JAVA_HOME

 

Step 3: Check the Java Version

In the terminal, enter the following commands

$ java -version
$ javac -version

 



Download and Install Java Development Kit (JDK) on Windows, Mac, and Linux

Setting up a Suitable Development Environment is necessary before one can begin creating Android Applications. It makes it easier for developers to use the tools required to create any Application and ensures that all Operations or Processes run smoothly. Download and Install JDK in order to create Android Application Source Files using the Java or Kotlin Programming Language. The system will execute the code using a set of Libraries and Compilers. JDK, JRE, and JVM should not be confused with one another, for more Differences between JDK, JRE, and JVM. This article describes the step-by-step process for installing and configuring the JDK on the 3 most popular Computer Operating Systems in order to begin the process of developing Android Applications.

Similar Reads

Java JDK Download

The JDK can be installed on the following Platforms:...

Install JDK on Microsoft Windows

Step 1: Download and Install Java Development Kit (JDK)...

Install JDK on Linux

Step 1: Download and Install Oracle Java Development Kit (JDK)...

Install JDK on MacOS

Step 1: Download and Install Oracle Java Development Kit (JDK)...

Contact Us