一. 解压安装jdk
在shell终端下进入jdk-6u14-linux-i586.bin文件所在目录,
执行命令 ./jdk-6u14-linux-i586.bin 这时会出现一段协议,连继敲回车,当询问是否同意的时候,输入yes,回车。之后会在当前目录下生成一个jdk1.6.0_14目录,你可以将它复制到 任何一个目录下
二、执行
[root@localhost usr]# java -version
java version "1.4.2"
gij (GNU libgcj) version 4.1.2 20080704 (Red Hat 4.1.2-46)
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.
发现是1.4.2
三、删除原有的JDK
[root@localhost usr]# alternatives --remove jar /usr/bin/fastjar
[root@localhost usr]# alternatives --remove jar.1.gz /usr/share/man/man1/fastjar.1.gz
[root@localhost usr]#
四、删除原有的连接
[root@localhost usr]# cd /usr/bin/
[root@localhost