How to Download and Install OpenJDK on Windows 11

If you’re learning Java or developing apps on Windows 11, you’ll need a reliable Java Development Kit (JDK). While Oracle JDK is common, OpenJDK (Open Java Development Kit) is the open-source alternative — completely free, lightweight, and used by many professionals and organizations.

In this guide, we’ll walk you through what OpenJDK is, how it differs from Oracle JDK, and step-by-step instructions on how to download, install, and configure OpenJDK on Windows 11.

What Is OpenJDK?

OpenJDK is an open-source implementation of the Java Platform, Standard Edition (Java SE). It’s developed and maintained by Oracle along with the open-source community. Many major Java distributions like Adoptium Temurin, Amazon Corretto, and Zulu OpenJDK are built upon OpenJDK.

You can use OpenJDK for:

  • Building and running Java applications
  • Developing software using popular IDEs like Eclipse, IntelliJ IDEA, or NetBeans
  • Running Java-based servers and tools (like Tomcat, Jenkins, or Minecraft servers)

OpenJDK vs. Oracle JDK: What’s the Difference?

FeatureOpenJDKOracle JDK
LicenseOpen-source (GPLv2)Commercial (requires subscription for production use)
CostFreeFree for development, paid for commercial use
UpdatesFrequent community updatesRegular enterprise updates
PerformanceSimilar to Oracle JDKSimilar — both share the same core code

If you’re a student, developer, or hobbyist, OpenJDK is the perfect choice since it’s free and community-supported.

Step 1: Download OpenJDK for Windows 11

There are several trusted providers for downloading OpenJDK builds. The most popular ones are: Let’s go with OpenJDK official website, as it’s stable, open-source, and works great on Windows 11.

  1. Visit the OpenJDK download page.
  2. Under Operating System, select Windows.
  3. Choose your Architecture (x64 or ARM64).
  4. Select the latest version (e.g., OpenJDK 21 or 22).
  5. Download the .msi installer file.

Step 2: Install OpenJDK on Windows 11

Once the installer finishes downloading, follow these steps:

  1. Double-click the .msi file to start installation.
  2. Click Next to begin the setup wizard.
  3. Accept the license agreement and click Next again.
  4. Choose the installation directory (or leave the default one).
  5. Make sure to check the box that says:
    Set JAVA_HOME variable
    Add to PATH
  6. Click Install to start the installation.
  7. Once it completes, click Finish.

That’s it — OpenJDK is now installed on your system!

Step 3: Verify the Installation

To ensure OpenJDK installed correctly, open Command Prompt and type:

java -version

You should see something like this:

openjdk version "21.0.2" 2024-04-16
OpenJDK Runtime Environment Temurin-21.0.2
OpenJDK 64-Bit Server VM (build 21.0.2+13)

If you see this output, congratulations — Java is now successfully installed!

Step 4: Set JAVA_HOME Manually (If Needed)

Sometimes, the installer might not automatically set the JAVA_HOME path. Here’s how to do it manually:

  1. Press Windows + S, type “Environment Variables,” and open Edit the system environment variables.
  2. In the System Properties window, click Environment Variables.
  3. Under System variables, click New.
  4. Set:
    • Variable name: JAVA_HOME
    • Variable value: The path where OpenJDK is installed, e.g.
      C:\Program Files\Eclipse Adoptium\jdk-21
  5. Click OK to save.
  6. Then select the Path variable → click EditNew → and add: %JAVA_HOME%\bin

Restart your terminal or PC and test again with:

java -version

Step 5: Compile and Run a Test Java Program

To confirm everything works, create a simple test file.

1. Create a new file

Open Notepad and type:

public class Hello {
    public static void main(String[] args) {
        System.out.println("Hello OpenJDK on Windows 11!");
    }
}

Save it as Hello.java in any folder.

2. Open CMD in that folder

Right-click the folder → click Open in Terminal (or use cd to navigate).

3. Compile the program

javac Hello.java

4. Run it

java Hello

If you see:

Hello OpenJDK on Windows 11!

then everything is working perfectly.

Conclusion

Installing OpenJDK on Windows 11 is simple, fast, and completely free. Whether you’re developing applications, running Java-based software, or learning programming, OpenJDK provides all the essential tools you need — without licensing restrictions.

By following this guide, you’ve learned how to download, install, and configure OpenJDK, as well as how to run your first Java program successfully.

Posted by Arpita

With a background in Computer Science, she is passionate about sharing practical programming tips and tech know-how. From writing clean code to solving everyday tech problems, she breaks down complex topics into approachable guides that help others learn and grow.