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:
- Press Windows + S, type
cmd, and open Command Prompt. - Type the following command and press Enter:
java -version - 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) - 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).
- Visit the official Oracle JDK page: https://www.oracle.com/java/technologies/downloads/
- Scroll down to find the latest Java SE Development Kit (JDK) version (e.g., JDK 25).
- Under the Windows section, download the
.exeinstaller (x64 Installer).
Step 3: Install Java JDK on Windows 11
Once the .exe file finishes downloading:
- Double-click the installer to start setup.
- Click Next to proceed through the wizard.
- Choose the installation path or leave it as default:
C:\Program Files\Java\jdk-25 - Click Next, then Install.
- 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):
- Visit the Java Runtime Environment download page: https://www.java.com/en/download/
- Click Download Java for Windows.
- 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
- Press Windows + S, type environment variables, and select Edit the system environment variables.
- In the System Properties window, click Environment Variables.
2. Set JAVA_HOME
- Under System variables, click New.
- Enter the following:
- Variable name:
JAVA_HOME - Variable value:
C:\Program Files\Java\jdk-25
- Variable name:
- Click OK.
3. Add Java to PATH
- In the same System variables section, select Path and click Edit.
- Click New and add:
%JAVA_HOME%\bin - 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:
- Open Command Prompt again.
- Run these commands one by one:
java -version javac -version - 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.
- Open Notepad and paste this code:
public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, Java 25 on Windows 11!"); } } - Save the file as
HelloWorld.javain a folder likeC:\JavaTest. - Open Command Prompt and navigate to that folder:
cd C:\JavaTest - Compile the program:
javac HelloWorld.java - 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.