Installing Java on MacOS
To install Java on a Mac, you can follow these steps:
- Open a web browser and visit the official Oracle Java website at https://www.oracle.com/java/technologies/downloads/archive.
- Look for Java SE downloads list. From that list, select the Java version that you wish to download.
- Find macOS x64 DMG Installer (.dmg) file and click on the download link.
- Next, review and accept the Oracle Technology Network License Agreement for Oracle Java SE and then click on the download button.
- You'll be redirected to the oracle login page. Sign-in into your Oracle account. When the download dialog box appears prompting you to run or save the file, choose to save the file to install it later.
- Once the download is complete, open the .dmg file by double-clicking on it.
- A new window will open with the JDK installer package. Double-click on the package file (.pkg) to start the installation.
- Follow the on-screen instructions to complete the JDK installation process. You may need to provide your macOS system password during the installation.
- After the installation is completed, you can verify if the JDK is installed correctly. To do this, open the Terminal. Type java -version and press Enter. It should display the installed Java version information as shown in the example below:
java version "17.0.2_231" Java(TM) SE Runtime Environment (build 17.0.2_231-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.231-b11, mixed mode)
Congratulations, you have successfully downloaded and installed the JDK on your Mac. You can now start using Java for development purposes.