How to Install Java 17 on Windows (2025 Beginner Guide + Fixes for CMD Errors)

Backend BrewBackend Brew
3 min read

TL;DR – Java not working in your command prompt? Follow this step-by-step guide to install Java 17, set up JAVA_HOME, and fix 'java' is not recognized errors — even if you're a beginner.

Why This Guide?

Java is the foundation for Spring Boot, backend APIs, and Android development. But even installing it correctly is where many get stuck — especially when setting environment variables.

I faced every one of these issues myself. So I created this clean, real-world guide to save you hours of Googling and trial & error.


Prerequisites

  • A Windows 10 or 11 system

  • Basic familiarity with downloading & installing apps

  • Admin access to your PC


Step 1: Download Java 17 JDK

  1. Go to Oracle's Java SE 17 Archive

  2. Scroll to Windows x64 Installer and click Download

  3. You’ll get an .exe file like:

     jdk-17.0.10_windows-x64_bin.exe
    

Step 2: Install Java

  1. Open the .exe file

  2. Click:

     Next → Next → Finish
    
  3. It will install Java to:

     C:\Program Files\Java\jdk-17.0.x
    

📝 Tip: Note this location — you’ll need it later.


🔍 Step 3: Check Java in Command Prompt

Now let’s test the installation:

java -version

If it works, you’ll see something like:

java version "17.0.10"
Java(TM) SE Runtime Environment (build 17.0.10+8)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.10+8, mixed mode, sharing)

✅ Congrats! You can skip to the end.

❌ If you see:

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

→ Continue to the next step.


🧠 Step 4: Add Java to System Environment Variables

1. Open Environment Variables:

  • Press Windows + S → Type: environment

  • Click: Edit the system environment variables

  • Go to System Properties → Environment Variables


2. Add Java to Path

Under System Variables:

  • Click on PathEdit

  • Click New

  • Paste this (adjust version if needed):

C:\Program Files\Java\jdk-17.0.x\bin

✔ Click OK → OK → OK


🏷️ Step 5: Set JAVA_HOME Variable

Back in Environment Variables:

  • Under System Variables, click New

  • Name: JAVA_HOME

  • Value:

      C:\Program Files\Java\jdk-17.0.x
    

✔ Click OK to save


🔁 Step 6: Restart CMD and Verify

Close all open Command Prompt windows. Then open a new one and type:

java -version
echo %JAVA_HOME%

You should now see:

  • Java version

  • Your JAVA_HOME path

✅ You're all set.


🧯 Common Errors and Fixes

❌ Error✅ Fix
'java' is not recognizedAdd Java /bin folder to Path
Wrong version showingRemove old Java entries in Path
JAVA_HOME not workingRestart CMD, check for typos

🎁 BONUS: Java Setup Silent Video

I also created a short silent screen recording of this process:
🎥 Watch: “Install Java 17 on Windows (No Voice)” on YouTube


📌 Summary Checklist

✅ Download Java 17
✅ Install it (default settings)
✅ Add to Path
✅ Set JAVA_HOME
✅ Restart CMD and verify


🙌 What's Next?

I'm currently building a full Spring Boot backend series with real-world bugs and apps — as I learn.

If you're also starting backend development, follow me here or on Dev.to to stay updated.


💬 Let's Connect

Have questions or errors I missed? Comment below — I reply to all of them.
Found this helpful? Consider sharing it or bookmarking it for your future setups.

0
Subscribe to my newsletter

Read articles from Backend Brew directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Backend Brew
Backend Brew