How to install JDK ON WINDOWS

 

How to Install Java JDK on Windows: A Beginner's Step-by-Step Guide (2026)

If you're starting your journey in Java programming, the first thing you'll need is the Java Development Kit (JDK). The JDK provides all the tools required to write, compile, and run Java applications on your computer.

In this guide, you'll learn how to install Java JDK on Windows step by step, verify the installation, and set up environment variables correctly.

What is Java JDK?

Java Development Kit (JDK) is a software package that contains everything needed for Java development, including:

  • Java Compiler (javac)

  • Java Runtime Environment (JRE)

  • Development Tools

  • Debugging Utilities

Without the JDK, you cannot compile or build Java applications.

System Requirements

Before installing Java JDK, make sure your computer meets the following requirements:

  • Windows 10 or Windows 11

  • At least 4 GB RAM

  • Internet connection

  • Administrator privileges

Step 1: Download Java JDK

Visit Oracle's official Java download page and download the latest JDK version for Windows.

Choose:

  • Windows x64 Installer (.exe)

Always download Java from official sources to ensure security and compatibility.

Step 2: Install Java JDK

After downloading:

  1. Double-click the installer file.

  2. Click "Next."

  3. Select the installation folder.

  4. Click "Install."

  5. Wait for the installation process to finish.

  6. Click "Finish."

The JDK is now installed on your computer.

Step 3: Verify Installation

Open Command Prompt and type:

java -version

You should see output similar to:

java version "24.x.x"

Next, verify the Java compiler:

javac -version

Expected output:

javac 24.x.x

If both commands work correctly, Java is installed successfully.

Step 4: Configure JAVA_HOME

Some development tools require the JAVA_HOME environment variable.

Follow these steps:

  1. Search for "Environment Variables" in Windows.

  2. Click "Edit the system environment variables."

  3. Select "Environment Variables."

  4. Click "New" under System Variables.

Enter:

Variable Name:

JAVA_HOME

Variable Value:

C:\Program Files\Java\jdk-24

Replace the version number with your installed JDK version.

Step 5: Update Path Variable

  1. Locate the Path variable.

  2. Click Edit.

  3. Click New.

  4. Add:

%JAVA_HOME%\bin

Save all changes and restart Command Prompt.

Step 6: Create Your First Java Program

Create a file named:

HelloWorld.java

Add the following code:

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}

Compile the program:

javac HelloWorld.java

Run the program:

java HelloWorld

Output:

Hello, World!

Congratulations! Your Java environment is working correctly.

Common Errors and Solutions

Java Is Not Recognized

Problem:

'java' is not recognized as an internal or external command

Solution:

  • Check JAVA_HOME configuration.

  • Verify Path variable settings.

  • Restart Command Prompt.

Javac Command Not Found

Problem:

'javac' is not recognized

Solution:

  • Ensure the JDK is installed, not just the JRE.

  • Verify that the JDK bin folder is added to the Path variable.

Why Learn Java?

Java remains one of the most popular programming languages in the world because it is:

  • Beginner-friendly

  • Platform-independent

  • Widely used in enterprise software

  • Essential for Android development

  • In-demand among employers

Java developers continue to enjoy strong career opportunities across software development, web applications, cloud computing, and mobile app development.

Final Thoughts

Installing Java JDK is the first step toward becoming a Java developer. Once the JDK is installed and configured correctly, you can begin learning Java programming, building desktop applications, creating Android apps, and exploring advanced technologies like Spring Boot and microservices.

Take your time to understand the setup process, and always verify your installation before starting any Java project.