标签:
1.查询原来安装的openjdk
rpm -qa |grep java rpm -qa |grep jdk
2.卸载原来安装的openjdk
rpm -e --nodeps java-1.7.0-openjdk-1.7.0.45-2.4.3.3.el6.x86_64
3.安装需要的jdk
rpm -ivh jdk-7u55-linux-x64.rpm
4.配置环境变量 vim /etc/profile
export JAVA_HOME=/usr/java/jdk1.7.0_55
export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
export classpath=.:/usr/java/jdk1.7.0_55/lib:/usr/java/jdk1.7.0_55/jre/lib
5.让配置生效 source /etc/profile
标签:
原文地址:http://www.cnblogs.com/xin-yang/p/5486509.html