1)卸载系统自带的jdk版本:
查看自带的jdk:
#rpm -qa|grep gcj
可能看到如下类似的信息:
libgcj-4.1.2-44.el5
java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
使用rpm -e --nodeps 命令删除上面查找的内容:
#rpm -e –nodeps java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
2)卸载rpm安装的jkd版本
查看安装的jdk:
#rpm -qa|grep jdk
可能看到如下类似的信息:
jdk-1.6.0_22-fcs
卸载:
#rpm -e --nodeps jdk-1.6.0_22-fcs
1安装jdk
chmod +x jdk-6u7-linux-i586.bin
2.执行安装文件
./jdk-6u7-linux-i586.bin
3.配置环境变量 这里我的jdk是放在/usr/java目录里面 所以路径是/usr/java/jdk1.6.0.24
export JAVA_HOME=/usr/java/jdk1.6.0_24 export JRE_HOME=/usr/java/jdk1.6.0_24/jre export PATH=$JAVA_HOME/bin:JRE_HOME/bin:$PATH export CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib: