Download & Install OpenJDK 18 on Windows
- Details
- Written by Nam Ha Minh
- Last Updated on 15 April 2022   |   Print Email
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:
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:
If you see the result like this, that means you have successfully installed OpenJDK 18 on your Windows computer.
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