|

How to Install Java on Windows 11: Temurin, Oracle JDK, and winget

How to Download and Install Java on Windows 11: Easy Guide

To install Java on Windows 11, the simplest path is winget: open Terminal as Administrator and run winget install EclipseAdoptium.Temurin.21.JDK for the free OpenJDK build. For Oracle JDK, download the installer from oracle.com/java/technologies/downloads. For end users running a Java app like Minecraft, download the Java Runtime from java.com and run the installer.

Applies to: Windows 11 (23H2, 24H2, 25H2) and Windows 10 (22H2) | Java 21 LTS and Java 17 LTS | Last updated: May 4, 2026

How to Download and Install Java on Windows 11

Key Takeaways

  • Pick the right Java for your use case: JRE (run Java apps), JDK (build Java apps), or a full distribution like Adoptium Temurin.
  • Adoptium Temurin (free OpenJDK) is the safest default for most users. It is a no-cost, production-ready build maintained by the Eclipse Foundation with no licensing strings attached.
  • Oracle JDK is free for personal use under the NFTC license as of Oracle JDK 17 and later, but commercial use of older Oracle JDK versions can require a paid subscription. OpenJDK builds avoid this risk entirely.
  • winget is the fastest install on Windows 11 — one command in Terminal installs Temurin or Oracle JDK without browsing to a download page.
  • Verify with java -version in a new Terminal window after installing.

Quick Steps

  1. Decide which Java you need: JRE for running apps, JDK for building them, or Temurin for either.
  2. Right-click the Start button and open Terminal (Admin).
  3. Install Adoptium Temurin 21 LTS: winget install EclipseAdoptium.Temurin.21.JDK
  4. Or for Oracle JDK 21: winget install Oracle.JDK.21
  5. Close and reopen Terminal, then verify the install: java -version
  6. If java is not recognized, add the JDK bin folder to PATH (e.g. C:\Program Files\Eclipse Adoptium\jdk-21\bin).

In This Guide


Which Java Should I Install on Windows 11?

Java comes in a few different flavours that all install the same way but solve different problems. Pick once, install once, and forget about it.

  • JRE (Java Runtime Environment) — runs Java apps but does not include a compiler. Use this if you only need to run something like Java-based Minecraft, OpenOffice, or a banking applet.
  • JDK (Java Development Kit) — runs and compiles Java code. Use this if you are writing Java, building Android apps, or running anything that needs javac. The JDK includes the JRE.
  • OpenJDK builds (Adoptium Temurin, Microsoft Build of OpenJDK, Amazon Corretto) — free, production-ready JDK distributions. Functionally equivalent to Oracle JDK for almost every use case, with no licensing concerns.

For most developers and PC users in 2026, I recommend Adoptium Temurin 21 LTS — it is free, well-maintained, and uses the Eclipse Foundation’s TCK-certified builds. The number 21 is the current Long-Term Support release; Java 17 is also still supported until 2029.

Note on Oracle licensing: Oracle JDK 17 and newer use the No-Fee Terms and Conditions (NFTC) license, which allows free personal and commercial use until the next LTS release. Older Oracle JDK versions (and post-NFTC commercial use) can require a paid Java SE Subscription. OpenJDK builds like Temurin sidestep all of this — they are GPL-licensed open source.

Method 1: Install Java With winget

winget is Microsoft’s built-in package manager on Windows 10 and 11. It is the fastest way to install Java because it skips the browser entirely. Right-click the Start button and choose Terminal (Admin), then run one of these:

Adoptium Temurin 21 LTS (recommended for most users):

winget install EclipseAdoptium.Temurin.21.JDK

Oracle JDK 21:

winget install Oracle.JDK.21

Microsoft’s OpenJDK build (Microsoft Build of OpenJDK 21):

winget install Microsoft.OpenJDK.21

winget downloads the installer, runs it silently, and adds Java to your system PATH automatically. Once it finishes, close and reopen Terminal — PATH changes only take effect in new terminal sessions — and run java -version to confirm it worked.

Method 2: Install Adoptium Temurin From the Installer

If winget is not your thing, the Eclipse Adoptium project ships standard Windows MSI installers. Open a browser and go to adoptium.net/temurin/releases.

  1. Pick JDK 21 – LTS (or 17 if your project needs an older LTS).
  2. Choose Operating System: Windows and Architecture: x64 (use ARM64 if you are on a Snapdragon Windows 11 PC).
  3. Download the .msi installer (not the .zip).
  4. Run the MSI. On the Custom Setup screen, change Set JAVA_HOME variable and Add to PATH to Will be installed on local hard drive — these are off by default and worth turning on.
  5. Click Install and approve the UAC prompt.

The installer drops Java into C:\Program Files\Eclipse Adoptium\jdk-21.0.x.x-hotspot\ and adds the bin folder to PATH if you ticked the option above.

Method 3: Install Oracle JDK From the Installer

Use this method if your employer or project specifically requires Oracle JDK. Open a browser and go to oracle.com/java/technologies/downloads.

  1. Pick the JDK version you need (Java 21 LTS is the current default).
  2. Choose the Windows tab and download either the x64 Installer (.exe) or x64 MSI Installer.
  3. Run the installer. Accept the default install location (C:\Program Files\Java\jdk-21) unless you have a reason to change it.
  4. Click Next through the wizard. The installer adds Java to PATH automatically as of Oracle JDK 17.
Java installer wizard on Windows 11 showing the install location and the Install button.

Once the installer finishes, close any open Terminal or Command Prompt windows so the new PATH takes effect, then verify with java -version.

Method 4: Install the Java Runtime Environment for End Users

If you only need to run a Java application — not develop one — and you do not need the JDK, you can install just the Java Runtime Environment (JRE) from java.com. This is the path many gamers take to run Java Edition Minecraft, although Mojang now bundles its own Java runtime with the launcher.

  1. Open a browser and go to java.com/en/download.
  2. Click Download Java. The download is the latest Java 8 JRE — Oracle still ships an 8-series public runtime for end users.
  3. Run the downloaded .exe, accept the UAC prompt, and click Install.
  4. Wait for the wizard to finish and click Close.
Java Runtime Environment installer running on Windows 11 with the User Account Control prompt visible.

Note: The Java 8 JRE from java.com is dated. If the Java app you are running supports a newer runtime, install Temurin 21 instead — it is faster, more secure, and free.

Verify the Install and Set JAVA_HOME

After any of the installs above, open a fresh Terminal window (right-click Start > Terminal) and run:

java -version
javac -version

java -version works after either a JRE or JDK install. javac -version only works after a JDK install — if it errors out, you installed the JRE rather than the JDK.

You can also verify visually by right-clicking the Start button and opening Installed apps. Scroll to the J section and you should see Eclipse Temurin JDK with Hotspot 21.x.x or Java 21 depending on which method you used.

Windows 11 Installed apps screen showing Java in the list of installed programs.

Set JAVA_HOME (only if a tool needs it)

Many Java tools — Maven, Gradle, certain IDEs — look for an environment variable called JAVA_HOME that points to the JDK install folder. The Adoptium installer can set this for you (Method 2 above), but if you skipped that or used winget, set it manually:

  1. Search the Start menu for Edit the system environment variables and open it.
  2. Click Environment Variables.
  3. Under System variables, click New.
  4. Variable name: JAVA_HOME. Variable value: the JDK install folder (e.g. C:\Program Files\Eclipse Adoptium\jdk-21.0.5.11-hotspot).
  5. Click OK on every dialog. Open a new Terminal and confirm with echo %JAVA_HOME%.

If you also want Java in development inside VS Code, see my guide on installing Java in VS Code for the matching extension setup.

Frequently Asked Questions

Should I install JRE or JDK?

Install the JDK if there is any chance you will compile Java code, run a Java IDE, or use build tools like Maven and Gradle. The JDK includes the JRE, so you do not lose anything by going with the JDK. Only install the bare JRE if you know you will only ever run Java apps and disk space is tight.

Is Adoptium Temurin really free for commercial use?

Yes. Adoptium Temurin is built from OpenJDK source under the GPL with the Classpath Exception, which permits commercial use without royalty payments. The Eclipse Foundation runs the project, and major companies including Microsoft, Red Hat, and Amazon contribute and ship their own builds based on the same upstream.

Do I need to restart my PC after installing Java?

No. You only need to close and reopen any Terminal or Command Prompt windows that were open before the install. Existing terminal sessions inherit the old PATH. Other apps will pick up the new Java automatically.

Why does java -version return “not recognized”?

The Java install folder is not on your PATH. Either re-run the installer with the “Add to PATH” option turned on, or add it manually: open Edit the system environment variables > Environment Variables > Path > Edit, then add the bin folder of your JDK install (e.g. C:\Program Files\Eclipse Adoptium\jdk-21\bin). Open a fresh Terminal afterwards.

Can I have multiple Java versions installed at once?

Yes. Each JDK installs into its own folder, and only the one on PATH or the one JAVA_HOME points to is the “active” one. Switch between them by editing PATH or by setting JAVA_HOME in the Environment Variables dialog. Tools like SDKMAN! (via WSL) or the jvms CLI make this easier on Windows.

How do I uninstall Java from Windows 11?

Open Settings > Apps > Installed apps, scroll to the J section, click the three-dot menu next to the Java entry, and choose Uninstall. Or via Terminal: winget uninstall EclipseAdoptium.Temurin.21.JDK (substitute the package ID you installed).

Similar Posts