On Windows

  1. Locate the Java installation directory.
  2. Go to Start > Control Panel > System > Advanced System Settings
  3. Select the Advanced tab, then click the Environment Variables button.
  4. Under System Variables, click New.
  5. 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
  6. Click OK from the New System Variable window, as well as on the Advanced tab dialog.