gij (GNU libgcj) version 4.1.2 20080704 (Red Hat 4.1.2-48)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[root@linux ~]# rpm -qa | grep gcj
libgcj-4.1.2-42.el5
java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
上面先确认jdk的具体版本号,然后使用rpm -e --nodeps命令删除上面查找的内容:
[root@linux ~]# chmod +x jdk-6u33-linux-i586.bin
[root@linux ~]# ./jdk-6u33-linux-i586.bin
.........
Press Enter to continue.....
Done.
[root@linux ~]# ls
jdk1.6.0_33 jdk-6u33-linux-i586.bin
[root@linux ~]# mv jdk1.6.0_33 /usr/local
[root@linux ~]# cd /usr/local
[root@linux local]# ls
bin etc games include jdk1.6.0_33 lib libexec sbin share src
[root@linux local]# vi /etc/profile
export JAVA_HOME="/usr/local/jdk1.6.0_33"
export CLASS_PATH="$JAVA_HOME/lib:$JAVA_HOME/jre/lib"
export PATH=".:$PATH:$JAVA_HOME/bin"
然后esc,输入:wq,保存退出。
[root@linux local]# source /etc/profile
Java(TM) SE Runtime Environment (build 1.6.0_33-b03)
Java HotSpot(TM) Client VM (build 20.8-b03, mixed mode, sharing)