How To Set Java_Home In Windows 10

In this tutorial, we will learn how to set the JAVA_HOME variable in Windows 10. The JAVA_HOME variable is an environment variable that points to the directory where Java SDK (Software Development Kit) is installed on your system. This variable is essential for many Java-based applications, build tools, and development environments to locate the Java SDK and function properly.


Before setting the JAVA_HOME variable, you should have the following:

  • Java Development Kit (JDK) installed on your system. You can download the latest version of JDK from the Oracle website.
  • Administrator rights to change the system environment variables.

Step 1: Locate the JDK Installation Directory

First, you need to find the installation directory of the JDK on your system. By default, JDK is installed in the Program Files folder (for 64-bit systems) or Program Files (x86) folder (for 32-bit systems).

For example, if you have JDK 14 installed, the default installation path would be:

  • 64-bit systems: C:\Program Files\Java\jdk-14
  • 32-bit systems: C:\Program Files (x86)\Java\jdk-14

Step 2: Set the JAVA_HOME Environment Variable

Follow these steps to set the JAVA_HOME variable in Windows 10:

  1. Right-click on the Start button and click on System.
  2. In the System window, click on Advanced system settings on the right side.
  3. In the System Properties window, go to the Advanced tab and click on the Environment Variables button at the bottom.
  4. In the Environment Variables window, click on the New button under the System variables section.
  5. In the New System Variable window, enter JAVA_HOME as the variable name and the path to the JDK installation directory as the variable value. Then, click OK.
  6. Back in the Environment Variables window, find the Path variable in the System variables section, and click on the Edit button.
  7. In the Edit environment variable window, click on the New button, and add %JAVA_HOME%\bin. Then, click OK.
  8. Click OK to close the remaining open windows.

Step 3: Verify the JAVA_HOME Variable

To verify that the JAVA_HOME variable has been set correctly, open a new Command Prompt and run the following command:

echo %JAVA_HOME%

This command should output the path to the JDK installation directory. If it does, the JAVA_HOME variable has been set correctly.


In this tutorial, we learned how to set the JAVA_HOME variable in Windows 10. Setting up the JAVA_HOME variable is an essential step for Java developers and users who work with Java-based applications, as it helps these applications locate the Java SDK on your system.