Setting the JAVA_HOME variable can be done in several ways.
1. Globally and at System level, i.e. no user is required to be logged in. This is the preferred way if you are configuring a server and planning to use boot strapped program that needs JAVA_HOME variable.
2. Globally and set for all logged in user, i.e. one user is needed to be logged in, to have the JAVA_HOME variable set.
3. User specific. Then the variable is only set when the designated user is logged in.
First open a Terminal (Applications → Accessories → Terminal), then enter:
sudo gedit /etc/environment
Append to the end of the file:
JAVA_HOME=/usr/lib/jvm/java-7-oracle
Check with this echo command.
echo $JAVA_HOME
1. Globally and at System level, i.e. no user is required to be logged in. This is the preferred way if you are configuring a server and planning to use boot strapped program that needs JAVA_HOME variable.
2. Globally and set for all logged in user, i.e. one user is needed to be logged in, to have the JAVA_HOME variable set.
3. User specific. Then the variable is only set when the designated user is logged in.
First open a Terminal (Applications → Accessories → Terminal), then enter:
sudo gedit /etc/environment
Append to the end of the file:
JAVA_HOME=/usr/lib/jvm/java-7-oracle
Check with this echo command.
echo $JAVA_HOME
Comments
Post a Comment