1. # vi ~ / .bashrc
Add: in the .bashrc file:
export JAVA_HOME = / usr / java / j2sdk1.4.2_08export CLASSPATH = $ CLASSPATH: $ JAVA_HOME / lib: $ JAVA_HOME / jre / libexport PATH = $ JAVA_HOME / bin: $ JAVA_HOME / jre / bin: $ PATH: $ HOMR / bin
2. Modify all users' environment variables
# VI / ETC / Profile
Add:
export JAVA_HOME = / usr / java / j2sdk1.4.2_08export CLASSPATH = $ CLASSPATH: $ JAVA_HOME / lib: $ JAVA_HOME / jre / libexport PATH = $ JAVA_HOME / bin: $ JAVA_HOME / jre / bin: $ PATH: $ HOMR / bin
3. # Source .bashrc
Reference URL is flying http://blog.9cbs.net/kunp/archive/2004/06/30447.aspx