Here are the environment variables for configuring Linux: (Remember source. bash_profile)
. Modify the/etc/profile file (global All users)
VI This file/etc/profile
At the end of the profile file, add:
Export JAVA_HOME=/USR/SHARE/JDK1.6.0_20
Export path= $JAVA _home/bin: $PATH
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
. /etc/profile execution of this command takes effect (a space is followed by a dot)
Method Two: Source/etc/profile
. Modify the. bash_profile file (using these environment variables for a user right)
At the end of the. bash_profile file, add:
Export JAVA_HOME=/USR/SHARE/JDK1.6.0_20
Export path= $JAVA _home/bin: $PATH
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
The shell terminal executes the following command: (for temporary use)
Export java_home=/usr/share/jdk1.6.0_14
Export path= $JAVA _home/bin: $PATH
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Configuring environment Variables for Linux