How to Install Java JDK on Windows

Before you can write your first Java program, you need to install the Java Development Kit (JDK). Think of the JDK as a toolbox for Java developers. It contains everything required to write, compile, and run Java programs.

INSTALL JAVA JDK

Install Java (JDK)

Before you can write your first Java program, you need to install the Java Development Kit (JDK).

Think of the JDK as a toolbox for Java developers. It contains everything required to write, compile, and run Java programs.

In this guide, you'll install Java on Windows in just a few minutes.


What is JDK?

Quick Answer :

Think of Java like learning English.

  • Java Language → The words

  • JDK → The notebook, pen, and dictionary needed to write

Without the JDK, you cannot create Java programs.


Before You Begin

Make sure you have:

  • Windows 10 or Windows 11

  • An internet connection

  • Administrator access (recommended)

New to Java?

Before installing Java, you may want to read:

These articles explain what Java is and why you'll be installing the Java SE Development Kit (JDK).


Step 1 : Download the JDK

Oracle JDK download page for Windows

Selecting a JDK installer on the Java download page

Windows JDK installer download in progress

Visit the official Oracle download page:

📄 Official Download

Choose:

  • Windows

  • x64 Installer (.exe)

Download the installer.

The file name will look similar to:

jdk-25_windows-x64_bin.exe

Step 2: Run the Installer

https://res.cloudinary.com/kmyt7ah6/image/upload/f_auto,q_auto,w_800,c_limit/v1791002183/thetechlane/migrated/openai/how-to-install-java-jdk-on-windows-02.jpg

https://res.cloudinary.com/kmyt7ah6/image/upload/f_auto,q_auto,w_800,c_limit/v1791002185/thetechlane/migrated/openai/how-to-install-java-jdk-on-windows-04.jpg

https://res.cloudinary.com/kmyt7ah6/image/upload/f_auto,q_auto,w_800,c_limit/v1791002187/thetechlane/migrated/openai/how-to-install-java-jdk-on-windows-06.jpg

Open your Downloads folder.

Double-click the installer.

When the setup wizard opens, click:

Click:

Next

The installation will begin.


Step 3: Choose the Installation Folder

The installer will suggest a location similar to:

C:\Program Files\Java\jdk-25

For beginners, it's best to leave this unchanged.

Click:

Next

The installation will begin.


Step 4: Finish Installation

After a few moments, you'll see the installation is complete.

Click:

Finish

🎉 Congratulations! Java is now installed on your computer.


Step 5: Verify Java Installation

Now let's make sure Java was installed correctly.

Press:

Windows + R

Type:

cmd

Press Enter.

A Command Prompt window will open.

Run this command:

java -version

You should see output similar to:

java version "25"
Java(TM) SE Runtime Environment
Java HotSpot(TM) 64-Bit Server VM

Now check the Java compiler:

javac -version

Expected output:

javac 25

If both commands work, Java is installed successfully.


Step 6: If Java Isn't Recognized

If you see this message :

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

Windows can't find Java.

This usually means the PATH variable hasn't been configured.

Don't worry—it's easy to fix.


Step 7: Set JAVA_HOME

https://res.cloudinary.com/kmyt7ah6/image/upload/f_auto,q_auto,w_800,c_limit/v1791002189/thetechlane/migrated/openai/how-to-install-java-jdk-on-windows-08.jpg

https://res.cloudinary.com/kmyt7ah6/image/upload/f_auto,q_auto,w_800,c_limit/v1791002192/thetechlane/migrated/openai/how-to-install-java-jdk-on-windows-10.jpg

https://res.cloudinary.com/kmyt7ah6/image/upload/f_auto,q_auto,w_800,c_limit/v1791002195/thetechlane/migrated/openai/how-to-install-java-jdk-on-windows-12.jpg

Search for:

Environment Variables

Open:

Edit the system environment variables

Click:

Environment Variables

Under System Variables, click:

New

Enter:

Variable Name

JAVA_HOME

Variable Value

C:\Program Files\Java\jdk-25

Click OK.


Step 8: Update the PATH Variable

Find the Path variable.

Click:

Edit

Then click:

New

Paste:

%JAVA_HOME%\bin

Click OK until all windows close.

Restart Command Prompt.

Run:

java -version

Everything should now work correctly.


Verify Everything

Run these commands one by one:

java -version
javac -version
where java

Expected output:

C:\Program Files\Java\jdk-25\bin\java.exe

Common Mistakes

Common mistakes when installing the Java JDK on Windows

💡 Did You Know?

The JDK includes the Java compiler (javac), which converts your Java source code into bytecode before it runs.

You'll learn exactly how this works in our Java Compilation Process and Bytecode Explained tutorials.



Quick Test

Run these commands one by one.

java -version
javac -version
where java

If all commands work correctly, you're ready to start coding.


Quick Summary

By following this guide, you learned how to:

  • Download the Java JDK

  • Install it on Windows

  • Verify the installation

  • Configure JAVA_HOME if needed

  • Check that Java is working correctly

You're now ready to write your first Java program.


Frequently Asked Questions

1. Do I need the JDK or the JRE?

You need the JDK if you want to write and compile Java programs.

2. Is Java free?

Yes. Several free OpenJDK distributions are available, and Oracle also provides free downloads for many development uses.

3. Can I install multiple Java versions?

Yes. Many developers keep multiple JDK versions installed for different projects.

4. Which Java version should beginners install?

The latest Long-Term Support (LTS) release is usually the best choice for learning and most real-world projects.

5. Can I write Java programs without an IDE?

Yes. You can use a simple text editor and the Command Prompt. Later, you'll install IntelliJ IDEA to make development easier.


Previous Lesson

← Java Editions (SE, EE, ME)

If you're still wondering which Java edition you installed, read that lesson first to understand the different Java platforms.

Next Lesson

➡️ Install IntelliJ IDEA

In the next tutorial, you'll learn how to:

  • Download IntelliJ IDEA Community Edition

  • Install the IDE

  • Configure the JDK

  • Create your first Java project

  • Run your first Java application


Continue Learning

Explore more beginner-friendly Java tutorials:

What Is Java?

History of Java

Features of Java

Java Editions (SE, EE & ME)

Installing the JDK

Installing IntelliJ IDEA

Your First Java Program

Java Program Structure

JDK vs JRE vs JVM


Have a Question?

If something isn't clear or you get stuck while learning Java, leave a comment below.

We'll do our best to explain it with simple words, practical examples, and code you can actually understand.

Happy Coding! ☕


Follow TheTechLane

Want more developer tutorials, programming tips, and tech updates?

Follow TheTechLane on LinkedIn, X, Instagram, Threads, and Pinterest to stay connected and catch new tutorials when they go live.

Learn. Build. Share.

— TheTechLane