Set Environment Variables

Perform the following steps after installing the JDK:

  • Set the JAVA_HOME Windows Environment Variable location to JDK installation path. (Example JAVA_HOME=C:\Program Files\Java\jdk1.6.x).
  • Set the Path to the bin directory of Java installation. (Example Path=C:\Program Files\Java\jdk1.6.x\bin).

To set the Environment Variable and Path in Windows XP:

  1. Right click on My Computer and select Properties.
  2. In the System Properties window, go to Advanced tab and select Environment Variables.
  3. In the Environment Variables window, go to User Variables and select New.
    1. Enter JAVA_HOME in the Variable Name field.
    2. Enter C:\Program Files\Java\jdk1.6.x (as per the example) in the Variable Value field.
    3. Click OK.
  4. Select Path from User Variables and click Edit.
    1. Add C:\Program Files\Java\jdk1.6.x\bin (as per the example) in the Variable Value field.
    2. Click OK.

To set the Environment Variable and Path in Windows Vista/7:

  1. Right click on Computer and select Properties. System window appears.
  2. Select Advanced System Settings link from the Control Panel Home pane. System Properties window appears.
  3. Select Environment Variables.
  4. In the Environment Variables window, go to User Variables pane and select New.
    1. Enter JAVA_HOME in the Variable Name field.
    2. Enter C:\Program Files\Java\jdk1.6.x (as per the example) in the Variable Value field.
    3. Click OK.

  5. Select Path from User Variables and click Edit.
    1. Add C:\Program Files\Java\jdk1.6.x\bin(as per the example) in the Variable Value field.
    2. Click OK.