Setting the JAVA_Home Environment Variable on Windows

Before you begin the installation process, you must configure environment variables that specify the location for your installation of 64-bit Java.

Set the JAVA_HOME variable to point to the Java application folder on your system, and add the path to the Java bin folder to the system Path variable.

Note: The environment variable settings described here may already be configured if you ran a setup application to install Java.
  1. Open the Windows Environment Variables settings dialog box.
    1. In Windows Control Panel, click System.
    2. In Computer name, domain, and workgroup settings, click Change settings.
    3. In the System Properties dialog box, click the Advanced tab, and then click Environment Variables.
      Note: Variable settings defined in the User variables box apply only for the current user login or profile. Variable settings defined in the System variables box apply for any user account that logs into Windows. The user variable setting is used when it has the same name as a system variable. On the other hand, the effective Path is the user Path variable appended to the system Path variable, so the order of entries are system entries followed by user entries.
  2. Add JAVA_HOME as a new Windows environment variable to specify the Java application folder.
    1. For System variables, click New if the JAVA_HOME variable does not already exist.
    2. For Variable name enter JAVA_HOME.
    3. For Variable value enter the full path to the Java application folder.
      For example, C:\Program Files\Java\zulu-8.
    4. Click OK.
  3. Add %JAVA_HOME%\bin to the Path variable.
    1. In System variables, click the Path variable.
    2. Click Edit.
    3. Double-click the first blank entry in the box.
    4. Enter %JAVA_HOME%\bin.
    5. Click OK