Java Home Path Setup - Windows

V A S G ReddyV A S G Reddy
1 min read

โœ… 1. Find Your Java Installation Path

Typically, Java is installed in one of the following locations:

  • C:\Program Files\Java\jdk-XX

  • C:\Program Files (x86)\Java\jdk-XX

Replace jdk-XX with your installed JDK version (e.g., jdk-17, jdk-21, etc.).


โœ… 2. Set JAVA_HOME (System Environment Variable)

๐Ÿ”น Method: Through System Properties

  1. Press Windows + S, type "Environment Variables", and click "Edit the system environment variables".

  2. In the System Properties window, click Environment Variables.

  3. Under System variables, click New:

    • Variable name: JAVA_HOME

    • Variable value: (Your JDK path, e.g., C:\Program Files\Java\jdk-21)

  4. Click OK.


Still in the Environment Variables window:

  1. Under System variables, find and select Path, then click Edit.

  2. Click New, and add:

     %JAVA_HOME%\bin
    

โœ… 4. Verify It Works

Open Command Prompt and run:

echo %JAVA_HOME%

You should see the path to your JDK.

Then verify Java:

java -version
javac -version
0
Subscribe to my newsletter

Read articles from V A S G Reddy directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

V A S G Reddy
V A S G Reddy