This tutorial explains all the steps required to install OpenJDK 12 on Windows 10. The steps to install OpenJDK 12 on other versions of Windows should be similar to the steps explained in this tutorial.
You can also follow the steps to install Java 10, and Java 11 published by Tutorials24x7. You can also follow the detailed steps required to install OpenJDK 12 on Ubuntu.
Notes: You may follow What's New In Java 13 to know about the new features introduced in JDK 13.
You can also follow How To Install OpenJDK 13 On Windows and How To Install OpenJDK 13 On Ubuntu to install OpenJDK 13 and How To Install Java 13 On Windows to install Oracle JDK.
You may also install the popular IDEs to develop Java applications by following - How To Install Eclipse For Java On Windows, How To Install IntelliJ IDEA for Java on Windows, and How To Install VSCode For Java On Windows.
Download OpenJDK
Open the JDK 12 GA Release site and download the distribution for Windows as highlighted in Fig 1.
Since the release of OpenJDK 14, the above download link will show warning message. We can download it from the Archived OpenJDK GA Releases.
Click on the zip download link to download OpenJDK for Windows. Also, verify your download using the given sha256 checksum.
Install OpenJDK
Extract the downloaded zip to the desired location. In my case, I have extracted the downloaded zip to C:\java\java-12. The zip extractor will extract the files to C:\java\java-12\jdk-12.0.1.
This is only step required to install OpenJDK on windows.
Set Environment Variables
In this step, we will configure the environment variables in order to use the OpenJDK from Command Prompt. Open Command Prompt and check the installed version of Java using the command java -version as shown in Fig 2.
It shows the version of Java 8 since my current version of Java is 8. In your case it might show another version of the Java if it's already installed, else it will show the message - Java is not recognized as internal or external command, operable program or batch file.
Right Click -> My Computer(This PC) -> Properties -> Advanced System Settings
The above steps will open the Windows settings panel as shown in Fig 3.
Now click on Environment Variables, select Path under System Variables section and click on Edit. We need to add the path of installed JDK to system Path.
Click on New Button and add the path to
Press OK Button 3 times to close all the windows. This sets the JDK 12 on system environment variables to access the same from the console.
Notes: Remove existing PATH values specific to previously installed Java. Also update JAVA_HOME, in case it was already set.
Now again open the console and test the Java version as shown in Fig 5.
It must show the OpenJDK version as shown in Fig 5.
These are the easy to install steps required to install OpenJDK on Windows.