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:

JDK 21 download 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:

Oracle JDK 21 setup program windows

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):

verify Oracle JDK 21 installation on windows

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:


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 

#1Yan Paing2024-04-02 02:46
nothing special , its ok kindly please
Quote