Setting JAVA_HOME

The JAVA_HOME environment variable points to the directory where the Java runtime environment (JRE) is installed on your computer.

The following tasks provide the information you need to set JAVA_HOME on Windows or UNIX systems.

To set JAVA_HOME on a Windows system:

  1. Right click My Computer and select Properties.

  2. On the Advanced tab, select Environment Variables, and then edit JAVA_HOME to point to the location of the of the Java Runtime Environment (JRE).

    For example, you might specify: C:\Program Files\Java\jdk1.8\jre

    JRE is part of the Java Development Kit (JDK) but can be downloaded separately.

To set JAVA_HOME on a UNIX system:

For Korn and bash shells, specify:

export JAVA_HOME=jdk-install-dir
export PATH=$JAVA_HOME/bin:$PATH

For a Bourne shell, specify:

JAVA_HOME=jdk-install-dir
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH

For a C shell, specify:

setenv JAVA_HOME jdk-install-dir
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
setenv PATH $JAVA_HOME/bin:$PATH
export PATH=$JAVA_HOME/bin:$PATH