How to download and install JDK on Windows

Are you a developer using the Java Development Kit? It’s easy to install on Windows in just a few simple clicks.

JDK on Windows

Windows 11 is a great operating system for productivity, but if you’re a programmer, there’s a high chance you’re going to need to install and use Java as part of your workflow. Oracle has the Java Development Kit (known as JDK for short) that you can use to help build your apps. It comes with all the tools you’ll need, like a virtual machine, debugging tools, and more. Installing the JDK on Windows is actually quite easy, so here’s how to get started with it.

How to install JDK on Windows

There are two ways to install JDK on Windows, and it’s a two-part process. You can install using a traditional EXE installer, or an MSI file, and then edit the Windows variables for Java files. Regardless, to install the JDK on Windows, your PC has to meet the system requirements set by Oracle. There is more technical information available through Oracle, but the basics is that your CPU architecture needs to be 64-bit.

Once you pass that, you’ll be good to go. Also, keep in mind that JDK installers only work with one Java release at a time. You can’t use an older installer on top of a new one. You’ll see an error prompting you to remove the newer version if you attempt to do this when a newer one is already installed. All that said, here’s what you can do.

Using the EXE installer

  1. Visit the Java Downloads page.
  2. Click the Windows tab.
  3. Download and choose your Java version. There’s currently JDK 21 and JDK 17.
    JDK Windows download
  4. Once the download is complete, double-click to launch the file.
  5. If prompted by the Windows UAC, click Yes.
  6. Click Next then Next and wait for the installation to be completed.
    Installing Java on Windows
  7. If you prefer, you also can run this installer silently using the command prompt, without interacting with any dialogues. Just type jdk-21_windows-x64_bin.exe /s in the command prompt.

Using the MSI Enterprise Installer

If you’re planning to run the JDK in an enterprise scenario, it’s suggested using an MSI installer. This installer runs with minimal dialogue and also supports silent installations, where you have to click through fewer commands. It’s even customizable.

  1. Visit the Java Downloads page.
  2. Click the Windows tab.
  3. Choose and download your Java version. There’s currently JDK 21 and JDK 17.
  4. Once the download is complete, double-click the MSI file to launch it.
    Launching the JDK on Windows
  5. Alternatively, you can use the Command Prompt to install silently, or with the basic UI.
  6. To install with the basic UI in Command Prompt, use the command: msiexec.exe /i jdk-20_windows-x64_bin.msi
    Installing JDK with the command prompt
  7. To install silently, use the command: msiexec.exe jdk-20_windows-x64_bin.msi /qn

Once the installation is complete, navigate to the following path in File Explorer. C> Program Files> Java>JDK21>bin. Copy the path in the navigation bar by tapping in the box and choosing Copy.

Configure JDK post-setup

Once the JDK setup is complete, you’ll need to tweak a few settings in Windows to get started with coding and building apps. You’ll need to edit system variables so you can edit JDK files.

  1. Open your Start Menu and search for: edit the system environment variables.
    Editing System Variable on Windows 11
  2. Click Open.
  3. Choose the Advanced tab.
  4. Click Environment Variables.
    Editing System Variable on Windows 11
  5. Under System Variables, double-click on Path.
  6. Click New.
    Editing System Variable on Windows 11
  7. Paste the path you copied earlier and click OK.
    Editing System Variable on Windows 11
  8. Close any other open windows.

Once installation is complete, launch Command Prompt and type the command java –version. If you see a readout, you’ve successfully installed Java on Windows! You’re now ready for development! The Java SDK is also available on macOS and Linux as well. So, if you have a device running those operating systems, check out our guide on how to install Java on Ubuntu, and how to install Java on macOS.