Setup Oracle JDK 21 on macOS
- Details
- Written by Nam Ha Minh
- Last Updated on 25 December 2023   |   Print Email
1. Download Oracle JDK 21 Installer for macOS
The first step of setting up JDK on macOS is download an installer. Oracle JDK 21 is distributed as compressed archive and DMG installer for macOS. Head over to the official Java Downloads page and you will see the following page:It’s recommended to use DMG Installer as it makes the setup convenient. Click one of the following download link:- ARM64 DMG Installer: download this if your Mac is equipped with Apple silicon (Apple’s CPU)
- x64 DMG Installer: download this if your Mac uses Intel’s CPU (probably old Mac)
shasum -a 256 jdk-21_macos-aarch64_bin.dmg
This command prints SHA256 checksum value of the specified file. Compare this checksum value against the one published on the download page (click link number 2 above). If they’re the same, it’s safe to run the DMG installer.2. Install Oracle JDK 21 on macOS
Now, to install Oracle JDK 21 on macOS, double click the DMG file. A JDK package will be shown. Then double click the package to launch JDK 21 installer, as shown below:- java -version: to check version of Java virtual machine.
- javac -version: to check version of Java compiler
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