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: JDK 13 is about to release on 17th Sept 2019. You may follow What's New In Java 13 to know about the new features introduced in JDK 13.

Download OpenJDK

Open the JDK 12 GA Release site and download the distribution for Windows as highlighted in Fig 1.

Fig 1

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.

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.