Setting the JAVA_HOME Variable in Windows
Set the JAVA_HOME Variable
To set the JAVA_HOME variable:
- Find out where Java is installed. If you didn't change the path during installation, it will be something like this:
- In Windows 7 right click My Computer and select Properties > Advanced.
In Windows 8 go to Control Panel > System > Advanced System Settings.
- Click the Environment Variables button.
- Under System Variables, click New.
- In the Variable Name field, enter:
JAVA_HOMEif you installed the JDK (Java Development Kit)
JRE_HOMEif you installed the JRE (Java Runtime Environment)
In the Variable Value field, enter your JDK or JRE installation path.
If the path contains spaces, use the shortened path name, for example
Note for Windows users on 64-bit systems
Progra~1 = 'Program Files'
Progra~2 = 'Program Files(x86)'
- Click OK and Apply Changes as prompted.
You'll need to close any re-open any command windows that were open before you made these changes as there's no way to reload environment variables from an active command prompt. If the changes don't take effect even after reopening the command window, restart Windows.