Download and Install OpenJDK 21 on Windows
- Details
- Written by Nam Ha Minh
- Last Updated on 02 December 2023   |   Print Email
1. Download binary distribution of OpenJDK 21
You should download the binary distribution of OpenJDK from a trusted source, i.e. JDK 21’s official download page. The following page will appear:
certutil -hashfile openjdk-21.0.1_windows-x64_bin.zip sha256
2. Install OpenJDK 21 on Windows
You can extract the downloaded zip file using Windows Explorer or the following command in Command Prompt window:tar -xf openjdk-21.0.1_windows-x64_bin.zip
It will unzip the file to a new directory named jdk-21.0.1 which contains the binary files of OpenJDK 21.Then you need to set the system environment variables JAVA_HOME and PATH in the following manner: JAVA_HOME = [Path to OpenJDK directory] PATH = JAVA_HOME\bin + PATHFor detailed instruction about setting up JAVA_HOME environment variable, check this article.And to verify the installation of OpenJDK, open a new command prompt window and type java -version to and javac -version as shown below:
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
About the Author:

Comments