卸载java 1.6 后 安装java1.7
rpm -qa |grep jdk
rpm -qa |grep gcj
rpm -qa |grep java
rpm -e gcj 或以上其他
发现无法彻底删除,
执行
alternatives --remove java /usr/share/java/libgcj-java-placeholder.sh
alternatives --remove java /usr/java/libgcj-java-placeholder.sh
alternatives --remove java /usr/bin/java/libgcj-java-placeholder.sh
alternatives --remove jar /usr/bin/fastjar
alternatives --remove jar.1.gz /usr/share/man/man1/fastjar.1.gz
安装jdk1.7
rpm -ivh jdk-7u3-linux-x64.rpm
cd /usr/java/
vim /etc/profile
添加
export JAVA_HOME=/usr/java/jdk1.7.0_03
export JRE_HOME=/usr/java/jdk1.7.0_03/jre
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export TOMCAT_HOME=/usr/local/tomcat
export CATALINA_HOME=/usr/local/tomcat
export PATH=$PATH:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:$JAVA_HOME/bin
source profile
java -version
阅读(986) | 评论(0) | 转发(0) |