O'Reilly logo

Java Garage by Eben Hewitt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting JAVA_HOME in Windows

The environment variable JAVA_HOME sets the location of your Java SDK so it can be accessed from various locations.

On Windows XP

1.
Navigate to Start > Control Panel > System.
2.
Choose the Advanced tab.
3.
Click Environment Variables.
4.
In the System Variables pane, click New.
5.
For Variable Name, type JAVA_HOME.
6.
For Variable Value, type C:\j2sdk1.5.0 for a default installation of the SDK. You may need to adjust your value based on your installation.

On Linux/UNIX

  1. Type the following code at the shell (you may need to change the location of the Java home directory for your system):

    $ export JAVA_HOME=/home/usr/jdk1.5
    
  2. To set the JAVA_HOME into the PATH, type the following:

    $ export PATH=$JAVA_HOME/bin:$PATH
    

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required