

The file is packaged in Mac's DMG installation file format. Before the download you have to accept the license agreement. Make sure to download the JDK, not the JRE (runtime environment). The official JDK should be downloaded from the official Oracle Java website. So let us see how to install and update the Java Development Kit (JDK) on macOS on your own. Since macOS 10.7 Lion (2011) it is not pre-installed anymore. In macOS 10.6 Snow Leopard and below Java was pre-installed and shipped with your Mac. If you want to write some Java code on your Mac, you will need the JDK to run your code.

The Java Development Kit (JDK) is essential for Java developers and contains the Java runtime environment as well as the Java compiler and other Java libraries. You will need to register with Oracle which is free to download older versions.This article explains how to install and update the Java Development Kit (JDK) on macOS, how to check Java version, and how to set the JAVA_HOME variable. Later, if you open Android Studio and a dialog box tells you there is a problem with working with dialog boxes, you may need to downgrade to avoid the bug.

CHECK POINT: Open the Command Prompt (Windows) or Terminal (Mac) and type java -version.Click the Close button to finish the installation of the JDK and JRE.On the second installation screen next to the phrase installed to: write down the location where the JDK will be installed.

NOTE: You will see two main dialog boxes that appears, the first is used to install the JDK (denoted by the jdk in the file path) and the second one is used to install the JRE denoted by the jre in the file path). Otherwise, double-click on the downloaded file and follow the installation prompts.
