Setting System Variables on a Linux Machine
The following steps will walk you through adding System Environment Variables to a machine running Linux.
indent |
---|
|
1. Open the terminal (shell) on your server. |
indent |
---|
|
2. Enter the following command(s) to define and export your JAVA_HOME variable. |
indent |
---|
|
Panel |
---|
borderColor | #ccc |
---|
bgColor | #ffffff |
---|
titleBGColor | #DDD9C3 |
---|
title | Set Variables Command |
---|
borderStyle | solid |
---|
| JAVA_HOME=/opt/java/jdk1.6.0 export JAVA_HOME |
|
Warning |
---|
|
- The variable value shown above is an example. When adding the JAVA_HOME variable in your environment you need to enter the path for your Java JDK directory.
- It is extremely important the path is to the JDK location and not to the Java root directory.
- The same holds true when you add the JBOSS_HOME and ANT_HOME variables in the next steps. The JBOSS_HOME variable needs to have the path for your JBoss directory and the ANT_HOME variable should have the path for your Ant directory.
|
indent |
---|
|
3. Enter the following command(s) to define and export your JBOSS_HOME variable. |
indent |
---|
|
Panel |
---|
borderColor | #ccc |
---|
bgColor | #ffffff |
---|
titleBGColor | #DDD9C3 |
---|
title | Set Variables Command |
---|
borderStyle | solid |
---|
| JBOSS_HOME=/opt/jboss-as-7.1.1.Final export JBOSS_HOME |
|
indent |
---|
|
4. Enter the following command(s) to define and export your ANT_HOME |
indent |
---|
|
Panel |
---|
borderColor | #ccc |
---|
bgColor | #ffffff |
---|
titleBGColor | #DDD9C3 |
---|
title | Set Variables Command |
---|
borderStyle | solid |
---|
| ANT_HOME=/opt/apache-ant-1.8.2 export ANT_HOME |
|
indent |
---|
|
5. Enter the following to update your PATH variable |
indent |
---|
|
Panel |
---|
borderColor | #ccc |
---|
bgColor | #ffffff |
---|
titleBGColor | #DDD9C3 |
---|
title | Set Variables Command |
---|
borderStyle | solid |
---|
| PATH=$PATH:$ANT_HOME/bin:$JAVA_HOME/bin |
|
Info |
---|
|
You do not need to export PATH because it has already been exported. If for some reason your PATH has never been exported then you will need to do it now. Simply adding variables to the PATH does not require you to export it again. |