Download and Install Oracle JDK 18 on macOS
- Details
- Written by Nam Ha Minh
- Last Updated on 28 April 2022   |   Print Email
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: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: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: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:
- How to set JAVA_HOME in macOS and Linux permanently
- How to set JAVA_HOME environment variable on Windows 10
- What are JVM, JRE and JDK
- How to write, compile and run a hello world Java program for beginners
- Java Core Language Tutorials
Comments