Skip to content
Follow
Windows

How to Install Oracle Java JDK on Windows 11

Richard
Written by
Richard
Dec 16, 2021 Updated Jul 14, 2026 4 min read
How to Enable or Disable Phone Link in Windows 11
How to Enable or Disable Phone Link in Windows 11

Oracle Java JDK installation on Windows 11 provides the essential tools for writing and running Java programs.

The Java Development Kit, or JDK, is a software package containing everything you need to develop Java applications, from writing code to running it.

This guide walks you through installing Oracle JDK 21, the newest long-term support version, on your Windows 11 computer. After installing it, you will have the necessary command-line tools to create and handle your Java projects.

⚡ Quick Answer

Download the JDK installer from Oracle’s website and run it. Follow the on-screen prompts, accepting default settings. After installation, edit system environment variables to set JAVA_HOME and add the JDK’s bin directory to the Path.

Prerequisites

Before you begin, ensure you have the following:

  • Administrative Rights: You must have an administrator account on your Windows 11 PC to install software and modify system environment variables.
  • Storage Space: Ensure you have at least 500MB of free disk space.
  • Internet Connection: Required to download the JDK installer.

Oracle JDK vs. OpenJDK: Which Should You Choose?

When installing Java JDK on Windows 11, you’ll encounter two primary options: Oracle JDK and OpenJDK.

Downloading and Installing Java

To install Java JDK on Windows 11, first download the installer file from Oracle's website. Once the installer file downloads, locate it in your Downloads folder and double-click to begin. You’ll need administrator permission for this step. Follow the on-screen prompts, sticking to the default settings for the Java JDK installation.

Oracle Java JDK installer download page on the official website
download java installer

When the installation completes, click ‘Close’.

Java installation wizard prompt on Windows 11 showing Next button
windows 11 java installer next

Java will install to C:\Program Files\Java\jdk-version-number. Click ‘Close’ when the installation finishes.

Java installation complete window confirming successful JDK setup on Windows 11
windows 11 java installation complete

Configuring Environment Variables

Setting up the JAVA_HOME environment variable correctly ensures your Java installation on Windows 11 functions as expected. This is done by navigating to system settings, finding “Environment Variables,” and clicking “New” under System variables. Then, enter ‘JAVA_HOME’ for the name and the folder where Java is installed for the value.

File explorer showing the installed Java JDK folder path on Windows
java home folder windows 11

Click the “Environment Variables” button at the bottom. Under “System variables,” click “New.”

Windows 11 system properties window for editing environment variables
windows 11 advanced environment variables
New system variable dialog box for setting JAVA_HOME on Windows
java environment home variable

Enter ‘JAVA_HOME’ as the variable name and your installation path (e.g., ‘📁C:\Program Files\Java\jdk-17’) as the value.

Configuring the JAVA_HOME variable value with the Java installation path
windows 11 java home folder variable
⚠️Warning
Locate the "Path" environment variable in the system's list of variables and select "Edit." Click the "New" button to add a new entry. Input the full directory path to the Oracle Java Development Kit (JDK) installation, for example, 📁C:\Program Files\Java\jdk-17. This step ensures Windows 11 can find the Java tools.
💻Code
%JAVA_HOME%\bin
Editing the system Path variable to include Java JDK tools
path variable in windows 11 java

Verifying the Installation

Open Command Prompt or PowerShell and type these commands:

java -version

javac -version

Troubleshooting Installation

If the ‘java -version’ command doesn’t work after you install Java on Windows 11, the problem is usually with the paths you set or forgetting to restart your command window. Double-check that your JAVA_HOME path is exactly correct. Always close and reopen your Command Prompt after making changes to environment variables.

  • Path Typos: Ensure your JAVA_HOME path matches your actual installation folder exactly.
  • Restart Terminal: Always close and reopen your Command Prompt after changing environment variables so the system can refresh the settings.
  • Permissions: Ensure you ran the installer as an administrator.

Summary

To install Java JDK on Windows 11, you’ll download the installer, run it as an administrator, and set up your JAVA_HOME and Path environment variables.

Is the Oracle JDK free for commercial use?

No, Oracle JDK is generally not free for commercial use under the current Oracle No-Fee Terms and Conditions. For business environments, it is often safer to use the Microsoft Build of OpenJDK or other free distributions to avoid licensing fees and compliance issues.

What is the difference between JRE and JDK?

The JRE (Java Runtime Environment) only allows you to run Java programs. The JDK (Java Development Kit) includes the JRE plus all the tools needed to develop, compile, and debug Java code. If you want to write your own programs, you must install the JDK.

Do I need to uninstall old versions of Java before installing a new JDK?

It is not strictly required, but it is highly recommended. Having multiple versions of Java can cause conflicts with your PATH variables. Uninstalling older versions through the Windows Settings menu ensures that your new installation is the primary version used by your system.

How do I check which version of Java is currently installed on 🪟 Windows 11?

Open the Command Prompt by typing “cmd” in the search bar. Type java -version and press Enter. The terminal will display the installed version number. If you see an error, Java is either not installed or your PATH variable is not configured correctly.

Was this guide helpful?

Tags: #Windows 11
Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

📚 Related Tutorials

How to Free Up Disk Space with OneDrive in Windows 11
Windows How to Free Up Disk Space with OneDrive in Windows 11
How to Enable or Disable Windows Ready Print in Windows 11
Windows How to Enable or Disable Windows Ready Print in Windows 11
Advanced Windows 11 Guide For Developers
Windows Advanced Windows 11 Guide For Developers
How to Refresh Copilot on Windows 11
Windows How to Refresh Copilot on Windows 11

No comments yet — be the first to share your thoughts!

Leave a Comment

Your email address will not be published. Required fields are marked *