Download and Install Oracle JDK 21 on Windows
- Details
- Written by Nam Ha Minh
- Last Updated on 01 December 2023   |   Print Email
Java development Kit (JDK) is required to create, develop, build and run Java applications. In this post, I’d like to share with you guys how to setup JDK version 21 on Windows operating system, with a distribution from Oracle corporation (Oracle JDK).
And you know, JDK 21 is the latest Long Term Support (LTS) release of Java SE platform, which was released on September 19th 2023. And Oracle JDK 21 is a commercial distribution of JDK. It’s free for personal, production and development use.
1. Download Windows Installer for Oracle JDK 21
It’s strongly recommend to download Oracle JDK installer from an authentic source. Go to the official Java downloads page, and click Windows section. You will see the following page:
Here, you can download zip archive, EXE installer or MSI installer. I recommend you use EXE installer that updates environment variable automatically, which makes the installation simple and easy.
So click the download link next to x64 Installer (1). It will download the EXE installer for Oracle JDK 21 (file name: jdk-21_windows-x64_bin.exe).
Before opening the setup program, it’s strongly recommended to verify integrity of the downloaded file by checking its SHA256 checksum value. Open a new Command prompt window and change the current directory to where the file is downloaded. Type the following command:
certutil -hashfile jdk-21_windows-x64_bin.exe sha256
Then compare the SHA256 checksum value printed by this command against the value published on the download page (click link 2 as shown in the above screenshot). If both values are identical, you can proceed next.
2. Install Oracle JDK 21 on Windows
Double click the downloaded EXE file to launch the setup program for Oracle JDK 21. It will appear as shown below:
Click Next twice to perform the setup with default installation directory at C:\Program Files\Java\jdk-21. Note that the installer will update the system environment variable PATH automatically, i.e. putting C:\Program Files\Common Files\Oracle\Java\javapath as the first entry in the PATH system environment variable.
Now, open another Command Prompt window and type java -version and javac -version to verify the installation. It will print the version of Java virtual machine (java.exe) and Java compiler (javac.exe):
This means Oracle JDK 21 has been installed successfully on Windows operating system, so you will be able to create, develop, build and execute applications running on Java virtual machine.
NOTE: If the PATH environment variable is not updated, follow this guide to update it manually.
Watch the following video to see how to setup Oracle JDK 21 on Windows in action:
Learn more:
- How to check Java version
- Java SE versions history
- How to set JAVA_HOME environment variable on Windows 10
- How to set environment variables for Java using command line
- How to write, compile and run a hello world Java program for beginners
- What are JVM, JRE and JDK
Comments