This post will guide you how to setup Java Development Kit version 20 on Windows operating system, with OpenJDK distribution. JDK 20 is a just regular update of Java SE platform, with most new features are still in incubator or preview stage.

And you know, OpenJDK 20 is a production-ready and open-source build of the JDK 20, which was released on March 21st 2023. To install OpenJDK 20 on Windows, kindly follow the steps described below.

 

1. Download binary distribution of OpenJDK 20

OpenJDK 20 is distributed as compressed archive files (zip and tar.gz) - no installer or setup program. Head over to JDK 20’s official download page, you will see the following page:

OpenJDK 20 download page

For Windows OS, click the hyperlink “zip” next to Windows/x64 as shown in the above screenshot. The result is the zip file openjdk-20.0.1_windows-x64_bin.zip being downloaded on your computer (around 187 MB in file size).

Next, you should verify the downloaded by checking SHA256 checksum value. Open a new Command Prompt on Windows, change the current directory to where the file is downloaded, and type the following command:

certutil -hashfile openjdk-20.0.1_windows-x64_bin.zip sha256

Then compare the SHA256 checksum value printed by this command against the value published on the official download page (link “sha256” as pointed in the above screenshot). And you can safely process if two values are the same.

 

2. Install OpenJDK 20 on Windows



Next, unzip the downloaded archive file. You can use the following command:

tar -xf openjdk-20.0.1_windows-x64_bin.zip

The result is a new directory created with the name jdk-20.0.1 - that contains the binary files of OpenJDK 20.

Then you need to set the system environment variables JAVA_HOME and PATH in the following form:

       JAVA_HOME = [Path to OpenJDK directory]

       PATH = JAVA_HOME\bin + PATH

For detailed instruction about setting up JAVA_HOME environment variable, check this article.

Finally, open a new command prompt window and type java -version to verify the installation. You should see the following output:

java version 20

You see, it prints openjdk version “20.0.1” - that means you have installed OpenJDK 20 on Windows successfully. You can also type javac -version to check version of Java compiler. You can also watch the following video to see the steps 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