Oracle JDK is a commercial distribution of Java SE Development Kit (JDK). Oracle JDK is free for personal, development and production use. Organizations may need to pay via Java SE subscription program.

And Oracle JDK 18 is a regular, feature release (non-LTS) of Java SE, which was released on March 22nd 2022.

In this article, I’d like to guide you the steps for getting Oracle JDK 18 up and running on macOS operating system.

 

1. Download DMG Installer for Oracle JDK 18

Head over to the official download page of Oracle JDK 18. You will see the following page:

download page oracle jdk 18

If you have Mac computer running on Intel’s chip, click the download link for x64 DMG Installer. Or if your Mac running on Apple’s CPU, click the download link for Arm 64 DMG Installer.

It’s strongly recommend to verity SHA256 checksum of the downloaded file before installing. Open a new Terminal and change the current directory to the directory where the .dmg file is downloaded to. And type the following command:

shasum -a 256 jdk-18_macos-aarch64_bin.dmg

Compare the output of this command against the SHA256 value published in the download page (click the sha256 link next to the DMG installer download link). If both are identical, you can safely usethe DMG installer for Oracle JDK 18.



 

2. Install Oracle JDK 18 on macOS

Double click the downloaded .dmg file, it will extract to JDK 18.0.1.pkg package. Then double click the JDK package icon to launch the installer. You’ll see JDK installer appears:

oracle jdk 18 macos installer

Click Continue and Install to proceed the installation. It should be very quick. And click Close to exit the installer. If asked to move the installer to trash, choose Move to Trash.

The JDK installer installs JDK 18 into /Library/Java/JavaVirtualMachines/jdk-18.0.1.jdk directory and puts java and javac programs under /usr/bin directory which is included in the PATH environment variable by default.

To verify, type java -version and javac -version in the terminal window:

check oracke jdk version macos

If you see this output, that means Oracle JDK 18 was successfully installed on macOS. To see the setup in action, I recommend you watch the following video:

 

Related Articles:


About the Author:

is certified Java programmer (SCJP and SCWCD). He began programming with Java back in the days of Java 1.4 and has been passionate about it ever since. You can connect with him on Facebook and watch his Java videos on YouTube.



Add comment

   


Comments 

#1bob2024-02-11 19:08
bob. the name is bobbie
Quote