How to set
JAVA_HOME environment variable to point to the Java installation directory.
- If you installed the Java Development Kit (JDK) set
- If you installed the Java Runtime Environment (JRE) set the
JRE_HOMEenvironment variable. [The steps remain the same]
- Locate your Java installation directory
If you didn’t change the path during installation, it’ll be something like C:\Program Files\Java\jdk1.8.0_91
- Go to Control Panel\System and Security\System -> Advanced system settings
- Click the Environment Variables button
- Under System Variables, click New
- In the Variable Name field, enter either:
JAVA_HOMEif you installed the JDK (or)
JRE_HOMEif you installed the JRE
- In the Variable Value field, enter your JDK or JRE installation path
- Click OK and Apply.
Open command prompt and type ‘java -version’. You should see the response like below:
java version “1.8.0_91”
Java(TM) SE Runtime Environment (build 1.8.0_91-b15)
- If the path contains spaces, use the shortened path name. For example,
For Windows users on 64-bit systems
Progra~1 = ‘Program Files’
Progra~2 = ‘Program Files(x86)’
- Close and reopen any command prompt windows you might have kept opened before executing these steps.