linux用户覆盖全局(自定义)变量环境
[dev_ydzj_1@localhostusr]$cd$HOME
[dev_ydzj_1@localhost~]$pwd
/home/dev_ydzj_1
[dev_ydzj_1@localhost~]$java-version
javaversion"1.6.0_24"
Java(TM)SERuntimeEnvironment(build1.6.0_24-b07)
JavaHotSpot(TM)ServerVM(build19.1-b02,mixedmode)
在公司看到上述结果,认为linux系统全局java环境是1.6,但是看到下面的执行结果我就疑惑了
[dev_ydzj_1@localhost~]$tail-3/etc/profile
exportJAVA_HOME=/opt/jdk/jdk1.5.0_15
exportCLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
exportPATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOMR/bin
找人解疑,看到下面结果,顿时有所感悟!
[dev_ydzj_1@localhost~]$less.bash_profile
#.bash_profile
#Getthealiasesandfunctions
if[-f~/.bashrc];then
.~/.bashrc
fi
#Userspecificenvironmentandstartupprograms
exportTOMCAT_HOME=/home/dev_ydzj_1/apache-tomcat-5.5.25
exportCATALINA_HOME=/home/dev_ydzj_1/apache-tomcat-5.5.25
exportJAVA_HOME=/opt/jdk/jdk1.6.0_24
exportCLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$TOMCAT_HOME/bin:$CATALINA_HOME/bin:$PATH:$HOME/bin
exportPATH
记录,备忘。嘿嘿!