卸载linux自带openjdk并安装sun jdk

rpm-qa|grepjava

rpm-e--nodepsjava-1.7.0-openjdk-1.7.0.45-2.4.3.3.el6.x86_64

rpm-e--nodepstzdata-java-2013g-1.el6.noarch

rpm-e--nodepsjava-1.6.0-openjdk-1.6.0.0-1.66.1.13.0.el6.x86_64

mkdir/usr/java

cp/home/data/jdk-7u79-linux-x64.rpm/usr/java/

rpm-ivhjdk-7u79-linux-x64.rpm

在profile.d下面加一个jdk.sh其中加入一下内容

exportJAVA_HOME=/usr/java/jdk1.7.0_79

exportCLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

exportPATH=$PATH:$JAVA_HOME/bin

source/etc/profile

相关推荐