How to Get Java for Windows 10

Download the free Microsoft Build of OpenJDK from Microsoft Learn and run its installer. It includes everything needed to run Java apps, so you don’t need a separate “JRE”. If a program says it needs a specific Java version, install that version.

Applies to: Windows 10 (64-bit). Checked against Microsoft Learn on September 28, 2026.

Which Java do I need?

  • To run a Java app or game: any current Java works for most programs. The Microsoft Build of OpenJDK is free and gets regular security updates.
  • To write Java code: the same download includes the tools for that too.
  • If an app names a version, such as Java 17 or 21, install that one. You can have more than one version.

Download and install

  1. Go to Microsoft Learn’s Download the Microsoft Build of OpenJDK page.
  2. Find the version you need. If you’re not sure, pick the newest long-term support (LTS) version.
  3. In the Windows row for x64, select the .msi or .exe file to download it.
Microsoft Build of OpenJDK download page with the Windows x64 installer link highlighted
Find the Windows x64 row (1) and select the installer file (2).
  1. Open the file you downloaded and follow the steps. Keep the options that add Java to your PATH and open .jar files with Java turned on.
  2. Select Yes if Windows asks for permission.

Check that it’s installed

  1. Select Start > Settings > Apps > Apps & features.
  2. Type OpenJDK in Search this list. You should see the Microsoft Build of OpenJDK.
Apps and features search showing the Microsoft Build of OpenJDK installed
Search for OpenJDK (1) and check that it’s listed (2).

You can also open Command Prompt and type java -version.

To run a Java program, see how to open a JAR file on Windows 10. To write Java code, see how to install the JDK on Windows 10.

Java for Minecraft and other games

Minecraft: Java Edition comes with its own Java, so you don’t need to install it separately. Just install the game from the official Minecraft Launcher. Other games or tools may still ask for Java; if they name a version, install that one.

Remove old Java versions

Old copies of Java, especially Java 8 installs that haven’t been updated, can miss security fixes. In Settings > Apps > Apps & features, search for Java and uninstall any versions that no app needs. Keep the one your apps use.

If Java doesn’t work

  • ‘java’ is not recognized: close Command Prompt and open a new one. If it still fails, run the installer again and keep the PATH option turned on.
  • An app says the Java version is wrong: install the exact version it asks for. Several versions can be installed at once.
  • A .jar file opens in an archive app: right-click it, select Open with > Choose another app, and pick the Java runtime.
  • A website says it needs the Java plug-in: today’s browsers don’t run Java in web pages, so that site won’t work no matter which Java you install.

Frequently asked questions

Is it safe and free?

Yes. The Microsoft Build of OpenJDK is free to use, and Microsoft publishes it with regular updates.

How do I update Java later?

Download the newer version from the same page and install it. Remove old versions you no longer need in Apps & features.

Do I need Java at all?

Only if an app or game asks for it. Windows 10 and most everyday apps don’t use Java, so there’s no need to install it just in case.

Is Oracle’s Java different?

Oracle also offers Java on its own site. For running apps at home, it works the same way. Oracle’s license terms for business use are different, so companies often choose a free build such as Microsoft’s.

What if my PC runs 32-bit Windows 10?

Microsoft’s build is for 64-bit Windows. To check, go to Settings > System > About and look at System type. On 32-bit Windows, you’ll need a 32-bit Java from another provider.

Does this work on Windows 11 too?

Yes. The same Microsoft Build of OpenJDK installer works on Windows 11, and the steps are the same. Java apps you used on Windows 10 run there too.

Microsoft’s reference is Install the Microsoft Build of OpenJDK. More help is on our Windows Help & Guides page.

Related: How to Change the Java Version in Windows 10.

Get Our Free Newsletter

How-to guides and tech deals

You may opt out at any time.
Read our Privacy Policy