How to Install Java JDK on Windows 11 (JDK 25, 2026)

Updated:

To install Java on Windows 11, download the JDK 25 installer (the current long-term-support release), run it, set the JAVA_HOME variable, and check the result with java -version in Command Prompt. The whole job takes about ten minutes. This guide covers each step, how to choose between Oracle JDK and the free Eclipse Temurin build, and how to fix the usual “java is not recognized” errors.

Installing Java for Android Studio? You don’t need to. Android Studio already includes its own JDK. See JDK for Android Studio: do you need Java?

Which JDK should you install?

Install a long-term-support (LTS) version. LTS releases get security updates for years, while the versions in between are supported for only six months.

VersionStatusGood for
JDK 25Latest LTS (September 2025)New projects and learning Java
JDK 21Previous LTSProjects or courses that ask for Java 21
JDK 17Older LTSOlder projects that require it

You can get the same JDK from different vendors. The two most common for Windows are:

  • Eclipse Temurin from Adoptium – free builds of OpenJDK with no usage restrictions. A good default for most people.
  • Oracle JDK from oracle.com – Oracle says JDK 25 updates are free under its No-Fee Terms and Conditions until September 2028; later updates move to a license that charges for production use.

Both behave the same for writing and running Java programs. Pick one and install only that one to avoid version confusion.

Before you start

  • Check whether Java is already installed: open Command Prompt (press Win, type cmd, press Enter) and run java -version. If a version prints, you may already have what you need.
  • Make sure you are an administrator on the PC – the installer needs it.
  • Windows 11 is 64-bit only, so always choose the x64 download (or aarch64 on ARM laptops such as Snapdragon PCs).

Step 1: Download the JDK installer

Step 2: Run the installer

Double-click the file and follow the prompts. Accept the default folder unless you have a reason to change it:

  • Temurin: C:\Program Files\Eclipse Adoptium\jdk-25…-hotspot
  • Oracle: C:\Program Files\Java\jdk-25

In the Temurin installer, open the feature list and switch on Set JAVA_HOME variable and Add to PATH. If you do, you can skip Step 3.

Step 3: Set JAVA_HOME and Path

Many tools (Maven, Gradle, IDEs) look for JAVA_HOME, so set it even if java already works.

  1. Press Win, type environment variables and open Edit the system environment variables.
  2. Click Environment Variables…
  3. Under System variables, click New… Name: JAVA_HOME. Value: your JDK folder from Step 2, for example C:\Program Files\Java\jdk-25. Click OK.
  4. Select the Path system variable, click Edit…, then New, and add %JAVA_HOME%\bin.
  5. Click Move Up until it sits above any other Java entry, then OK on every window.

Step 4: Check that Java works

Open a new Command Prompt (old windows keep the old settings) and run:

java -version
javac -version
echo %JAVA_HOME%

You should see version 25 for both java and javac, and your JDK folder for JAVA_HOME. To test the compiler, save this as Hello.java and run java Hello.java:

public class Hello {
    public static void main(String[] args) {
        System.out.println("Java is working!");
    }
}

Fix common problems

“’java’ is not recognized as an internal or external command”

Windows can’t find Java. Re-check the Path entry from Step 3, make sure it ends in \bin, and open a new Command Prompt.

java works but javac is not recognized

Your Path points at a Java runtime instead of the JDK. Move %JAVA_HOME%\bin to the top of Path.

The wrong version appears

Another Java is earlier in Path. Run where java to list every copy, then remove the old entry or uninstall the old version in Settings > Apps > Installed apps (search “Java”). Oracle installers can also add C:\Program Files\Common Files\Oracle\Java\javapath to Path; if it points at an old version, remove that entry.

Can you keep more than one JDK?

Yes. Install each version in its own folder and change JAVA_HOME (and the Path entry, which follows it) to switch. IDEs such as IntelliJ IDEA and Android Studio let you pick a JDK per project, so most people never need to switch system-wide.

FAQ

Is Java free on Windows 11?

Yes. Eclipse Temurin is free without restrictions, and Oracle offers JDK 25 updates free under its No-Fee Terms and Conditions until September 2028.

Do I need the JRE as well as the JDK?

No. Modern JDKs include everything needed to run Java programs; Oracle no longer ships a separate JRE for current versions.

Should I install JDK 25 or JDK 21?

JDK 25 unless a course, book or project asks for 21. Both are long-term-support releases.

How do I uninstall Java?

Go to Settings > Apps > Installed apps, search for “Java”, “JDK” or “Temurin”, and uninstall. Then delete any leftover JAVA_HOME and Path entries.

Related guides

WhatsApp us📞 Call now