Setting JAVA_HOME
Describes how to set JAVA_HOME on Windows or UNIX
systems.
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:
-
Open File Explorer, right click This PC, and then select Properties.
-
On the System > About page, click Advanced system setting.
-
On the System Properties page, click Environment Variables.
-
On the Environment Variables, under System Variables select JAVA_HOME and click Edit.
-
On the Edit System Variable page, then Variable Value, specify the location of the Java Runtime Environment (JRE).
For example, you might specify:
C:\Program Files\Java\jdk1.8\jreJRE is part of the Java Development Kit (JDK) but can be downloaded separately.
- Click OK.
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:$PATHFor a Bourne shell, specify:
JAVA_HOME=jdk-install-dir
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATHFor 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