OpenJDK 18 is an open-source distribution of Java SE Development Kit (JDK), released on March 22nd 2022. JDK 18 is a feature release as of Java SE’s 6-month release cadence - it’s not a LTS (Long Term Support) release.

In this post, I’d like to guide you how to download and install OpenJDK 18 on Windows operating system.

 

1. Download binary distribution of OpenJDK 18

Click this link to visit the official download page of OpenJDK 18. Then click on the Windows/x64 zip link to download the binary distribution of OpenJDK 18, as shown below:

openjdk 18 download

You’ll get the file openjdk-18_windows-x64_bin.zip downloaded. But before installation, you should verify the integrity of this file. Open a new command prompt window, change the current directory to the one containing the file. Then type the following command:

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

Compare the returned SHA256 checksum against the one published in the sha256 link (next to the zip link). If they are the same, you can proceed to install OpenJDK 18 safely.


2. Install OpenJDK 18 on Windows

Extract the downloaded zip file into a separate directory, e.g. D:\OpenJDK18. Then you need to update the system environment variables JAVA_HOME and PATH in the following way:

       JAVA_HOME = D:\OpenJDK18\jdk-18



       PATH = JAVA_HOME\bin + PATH

Open a new command prompt window with administrator privilege, and type the following commands:

setx -m JAVA_HOME "G:\OpenJDK18\jdk-18"

setx -m PATH "%JAVA_HOME%\bin;%PATH%";

Then open another command prompt to verify OpenJDK 18 installation. Type the java -version and javac -version commands:

openjdk 18 version

If you see the result like this, that means you have successfully installed OpenJDK 18 on your Windows computer.

 

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 

#1Nickname2022-08-02 22:38
Mec! fais gaffe certaines de tes commandes sont risquées. Pour certains, vous allez flingué vos variables d'env et devoir les refaire casi un par un par pour revenir comme avant.
Quote