• 欢迎访问金笔头博客,这是一个菜鸟(伪)程序员的自留地,欢迎访问我的github:点击进入

RedHat卸载自带JDK1.4并安装JDK1.6

Linux eason 5528次浏览 11个评论 扫描二维码


卸载jdk1.4
由于Redhat Enterprise Linux 5.6 中自带安装了jdk1.4.2的,所以在安装jdk1.6前我把jdk1.4.2的卸了,步骤如下:
1.打开终端输入 yum remove java
终端显示 Is this ok [y/N]:
2.输入y ,按回车。
终端显示 Complete!
此时jdk1.4已被卸了。
安装jdk1.6
1.把jdk-6u31-linux-i586.bin拷贝到 /j2ee/java目录下。
2.打开终端输入 cd /j2ee/java 按回车
3.添加执行权限,执行命令 chmod +x jdk-6u31-linux-i586.bin
4.执行命令 ./jdk-6u31-linux-i586.bin 即可完成安装。
5.环境变量设置。

#vi /etc/profile

在文件末尾输入 o 新增一行 进入编辑模式
RedHat卸载自带JDK1.4并安装JDK1.6
添加如下内容:

export JAVA_HOME=/usr/java/jdk1.6.0_31
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:/sbin


把光标切换到最后
输入 :wq 完成保存退出。
6.进入终端,输入 source /etc/profile 使刚刚修改的环境变量生效。
7.进入终端,输入 java -version查看安装结果


金笔头博客, 版权所有丨如未注明 , 均为原创, 转载请注明RedHat卸载自带JDK1.4并安装JDK1.6
喜欢 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
(11)个小伙伴在吐槽
  1. rShzEc I see something truly special in this website.
    fiverr seo2016-02-04 04:33 Reply Windows XP | Internet Explorer 6.0
  2. I was recommended this website by my cousin. I am not sure whether this post is written by him as nobody else know such detailed about my difficulty. You're incredible! Thanks!
    fiverr backlinks2016-02-02 01:46 Reply Windows XP | Opera 9.64
  3. I appreciate you sharing this article. Will read on...
    eebest8 seo2016-01-02 03:10 Reply Windows XP | Internet Explorer 7.0
  4. Every weekend i used to pay a quick visit this web site, as i wish for enjoyment, since this this web site conations really good funny stuff too.
    ugg dames muts2015-12-11 01:59 Reply Windows 7 | 未知浏览器
    • i'm very happy that you like my website :oops:
      wangyisheng2015-12-11 21:47 Reply Windows 7 | Chrome 45.0.2454.101
  5. Hi there to all, how is the whole thing, I think every one is getting more from this web page, and your views are nice designed for new users.
    peuterey giacche donna2015-12-10 05:49 Reply Windows 7 | 未知浏览器
    • thank you :mrgreen:
      wangyisheng2015-12-10 15:19 Reply Windows 7 | Chrome 45.0.2454.101
  6. It's the best time to make some plans for the future and it's time to be happy. I have learn this publish and if I could I want to recommend you some interesting things or suggestions. Maybe you could write subsequent articles relating to this article. I want to read more issues approximately it!
    ray ban viola prezzo2015-12-08 16:22 Reply Windows 7 | 未知浏览器
    • What aspect article of you want?
      wangyisheng2015-12-08 19:01 Reply Windows 7 | Chrome 45.0.2454.101
  7. 博主的主题真漂亮
    多伦多是哪个国家的2015-12-08 16:13 Reply Windows 7 | Chrome 47.0.2508.0
    • 谢谢 :mrgreen:
      wangyisheng2015-12-08 18:53 Reply Windows 7 | Chrome 45.0.2454.101