How to Install Java JDK and JRE on Windows 11

Java remains one of the most popular programming languages in the world, powering everything from enterprise software to mobile apps and web tools. If you’re learning Java or setting up your PC for development, you’ll need to install both the Java Development Kit (JDK) and the Java Runtime Environment (JRE).

In this detailed guide, we’ll walk you through the entire process of downloading, installing, and configuring Java JDK and JRE on Windows 11, including verifying your installation and setting up environment variables.

What Are JDK and JRE?

Before jumping into the installation, let’s quickly understand the difference between JDK and JRE — because you’ll need both in certain cases.

  • JDK (Java Development Kit):
    It includes everything required for Java development — compilers, debuggers, and tools needed to build Java applications.
  • JRE (Java Runtime Environment):
    It’s what allows Java programs to run on your PC. It contains the Java Virtual Machine (JVM) and core class libraries.

In short:

  • Use JDK if you’re a developer.
  • Use JRE if you just need to run Java applications.

Step 1: Check If Java Is Already Installed

Sometimes, Java might already be installed on your Windows 11 system. To check:

  1. Press Windows + S, type cmd, and open Command Prompt.
  2. Type the following command and press Enter: java -version
  3. If Java is installed, you’ll see output like: java version "21.0.3" 2024-04-16 LTS Java(TM) SE Runtime Environment (build 21.0.3+9-LTS) Java HotSpot(TM) 64-Bit Server VM (build 21.0.3+9-LTS, mixed mode)
  4. If you see an error like “Java is not recognized as an internal or external command”, then Java isn’t installed yet — continue with the next step.

Step 2: Download Java JDK for Windows 11

You can download the latest version of Java from Oracle or open-source distributions like Adoptium (Eclipse Temurin).

  1. Visit the official Oracle JDK page: https://www.oracle.com/java/technologies/downloads/
  2. Scroll down to find the latest Java SE Development Kit (JDK) version (e.g., JDK 25).
  3. Under the Windows section, download the .exe installer (x64 Installer).

Step 3: Install Java JDK on Windows 11

Once the .exe file finishes downloading:

  1. Double-click the installer to start setup.
  2. Click Next to proceed through the wizard.
  3. Choose the installation path or leave it as default: C:\Program Files\Java\jdk-25
  4. Click Next, then Install.
  5. Once complete, click Finish.

The JDK installation automatically includes the JRE, so you don’t need a separate JRE installer unless you specifically need it for older software.

Step 4: (Optional) Install Standalone JRE

If you need a standalone JRE (for running older Java applications or browsers):

  1. Visit the Java Runtime Environment download page: https://www.java.com/en/download/
  2. Click Download Java for Windows.
  3. Run the installer and follow the prompts to complete installation.

After installation, you’ll find JRE in:

C:\Program Files\Java\jre-<version>

Step 5: Set Up Environment Variables for Java

To make Java accessible from any directory in Command Prompt, you need to configure the JAVA_HOME and Path variables.

1. Open Environment Variables

  1. Press Windows + S, type environment variables, and select Edit the system environment variables.
  2. In the System Properties window, click Environment Variables.

2. Set JAVA_HOME

  1. Under System variables, click New.
  2. Enter the following:
    • Variable name: JAVA_HOME
    • Variable value: C:\Program Files\Java\jdk-25
  3. Click OK.

3. Add Java to PATH

  1. In the same System variables section, select Path and click Edit.
  2. Click New and add: %JAVA_HOME%\bin
  3. Click OK to save.

4. Apply and Close

Click OK on all windows to apply the changes.

Step 6: Verify Java Installation

After setting up environment variables, confirm everything is working:

  1. Open Command Prompt again.
  2. Run these commands one by one: java -version javac -version
  3. You should see the installed version details like: java version "25" 2025-09-17 Java(TM) SE Runtime Environment (build 25+36) Java HotSpot(TM) 64-Bit Server VM

If you see these outputs, congratulations — Java JDK and JRE are now installed and configured correctly on your Windows 11 PC! 🎉

Step 7: Test Java with a Simple Program

To verify everything is functioning properly, create and run a simple Java program.

  1. Open Notepad and paste this code: public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, Java 25 on Windows 11!"); } }
  2. Save the file as HelloWorld.java in a folder like C:\JavaTest.
  3. Open Command Prompt and navigate to that folder: cd C:\JavaTest
  4. Compile the program: javac HelloWorld.java
  5. Run the program: java HelloWorld

You should see:

Hello, Java 25 on Windows 11!

Wrapping Up

Installing Java JDK and JRE on Windows 11 is simple, but setting it up correctly ensures your development environment works flawlessly.

By following this guide, you’ve now:

  • Installed the latest JDK and JRE
  • Set up environment variables
  • Verified your installation
  • Compiled and executed your first Java program

You’re now fully ready to start coding, compiling, and running Java applications on your Windows 11 system.

Posted by Arpita

With a background in Computer Science, she is passionate about sharing practical programming tips and tech know-how. From writing clean code to solving everyday tech problems, she breaks down complex topics into approachable guides that help others learn and grow.