On Windows
- Locate the Java installation directory.
- Go to Start > Control Panel > System > Advanced System Settings
- Select the Advanced tab, then click the Environment Variables button.
- Under System Variables, click New.
-
In the New System Variable window, under
Variable name, enter
JAVA_HOME.
Under Variable value, enter where Java is installed. For example, C:\Program Files\Java\jdk1.7.0_07
- Click OK from the New System Variable window, as well as on the Advanced tab dialog.