How to Install OpenJDK on Windows - A Simple, Beginner-Friendly Guide
Last Updated :
23 Jul, 2025
Java is one of the most widely used programming languages in the world, consistently ranking in the top 10. If you're just starting to learn Java, the first thing you'll need is the Java Development Kit (JDK) installed on your computer.
This step-by-step guide is one place to know how to install OpenJDK in a Windows system, how to verify the installation, and how to run your first Java program. Also, the procedure you are following in this article is applicable on Windows 10 and Windows 11 also.
System Requirements to Install OpenJDK in Windows
- OS: Windows 10 (version 1903 or later) or any version of Windows 11
- Processor: Minimum 1 GHz processor (2 GHz or faster is recommended)
- Disk Space: Minimum 300 MB free space
- RAM: Minimum 2 GB of RAM (4 GB is better for smoother performance)
How to Install OpenJDK (Free Java) in Windows
In this section we are going to discuss the step-by-step process to install OpenJDK in Windows 10 and 11. So, follow these steps and complete the installation process by yourself.
Step 1: Download OpenJDK
- Open your web browser and go to the official OpenJDK website or trusted providers like Adoptium or Amazon Corretto.
- Choose the latest version of OpenJDK that matches your requirements.
- Download the Windows installer (.msi) or ZIP archive for the 64-bit version
Step 2: Install OpenJDK
If you downloaded the installer
- Once download is completed double-click on the downloaded installer file.
- Follow the instructions in the installation wizard.
- Select the installation directory or use the default one provided.
- Click “Install” and wait for the installation to complete.
If you downloaded the ZIP file
- Locate the downloaded ZIP file and extract it to a folder on your computer. For example, you can extract it to C:\Program Files\OpenJDK.
- Remember the folder path where you extracted OpenJDK, as you will need it later.
Step 3: Set Up Environment Variables
You need to set up environment variables to run Java programs from the command prompt.
- Open and search for "Environment Variables" in the Start menu and select "Edit the system environment variables".
- Click on “Edit the system environment variables”.
- In the System Properties window, click on the “Environment Variables” button.
- Under “System Variables”, find the “Path” variable and select it, then click “Edit”.
- Click “New” and enter the path to the
bin
folder of your JDK installation directory. For example, C:\Program Files\OpenJDK\bin
. - Click “OK” to save the changes.
Step 4: Verify the Installation
- Open the command prompt by pressing
Win + R
, type cmd, and hit Enter to open Command Prompt. - Type the following command to check the Java version:
java -version
- If OpenJDK is installed correctly, you will see the version details displayed in the command prompt.
Step 5: Run Your First Java Program
- Now that OpenJDK is installed and configured, you can run your first Java program.
- Create a new file named
HelloWorld.java
using a text editor like Notepad. - Write the following code in the file:
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
- Save the file as HelloWorld.java in a folder like, for example,
C:\JavaProjects
. - Open the command prompt and navigate to the folder where you saved the file using the
cd
command.
cd C:\JavaProjects
- Compile the program using the following command:
javac HelloWorld.java
- Run the program using the command:
java HelloWorld
- If everything is set up correctly, you will see the message “Hello, World!” displayed in the command prompt.
Conclusion
You have successfully installed OpenJDK on your Windows computer and run your first Java program. OpenJDK provides a free and reliable way to work with Java, making it an excellent choice for developers. Now you can start learning and building Java applications with ease.
Similar Reads
How to Install Apache OpenOffice on Windows? Apache OpenOffice is an open-source office suite. It provides free applications for spreadsheets, word processing, presentations, graphics, databases, etc. It was initially released on 1 May 2002 and developed by Sun Microsystems (1999â2009), Oracle Corporation (2010â2011). It is easy to use and ava
3 min read
How to Install Gradle on Windows? Gradle is a flexible build automation tool to build software. It is open-source, and also capable of building almost any type of software. A build automation tool automates the build process of applications. The Software building process includes compiling, linking, and packaging the code, etc. Grad
4 min read
How to Download and Install Eclipse on Windows Eclipse is one of the most widely used Integrated Development Environments (IDEs) among developers worldwide. Whether you're programming in Java, Python, C++, or other languages, Eclipse offers a powerful and customizable platform to code, debug, and test applications.In this guide, weâll walk you t
4 min read
How to Install FreeCAD on Windows? FreeCAD is a general-purpose, free, and open-source software. It was initially released on 29 October 2002 and written in C++ and Python languages. It is a parametric 3D computer-aided design (CAD) modeler and a building information modeling (BIM) software that supports the finite element method (FE
3 min read
How to Install John the Ripper on Windows? John the Ripper is password cracking software used by penetration testers and cyber security experts. It is completely free. In starting it was only made for Unix operating system but now it can be used on several other platforms also like windows, mac, etc. It was first released in 1996 by OpenWall
2 min read
How to Download and Install Blue Fish Editor on Windows? While itâs not quite as user-friendly as its commercial competitors or the other open-source options listed here, Bluefish offers a very fast WYSIWYG HTML editor that doesnât use a lot of system resources. Aimed at coders more than designers, it also includes support for a number of other programmin
2 min read