如何在Fedora 17 18 19 20 21 22 23 系统中安装 openjdk 1.6 与 1.7 1.8 共存
2015-12-27 20:22
751 查看
首先在高版本Fedora中,没有java-openjdk-1.6包,需要在网上下载,比如CentOS 7中的java-openjdk-1.6包:java-1.6.0-openjdk-1.6.0.36-1.13.8.1.el7_1.x86_64.rpm,实测可在Fedora 20中安装。
以下为转载,主要注意安装提示“
(
But this shows, that
and then I used the openjdk package which
(
Now I have both java 1.6 and java 1.7 on my system. Java 1.7 is my default. And Java 1.6 is in
PS: There won't be any conflicts when you install both 1.7 and 1.6. The reason for removing 1.6 from Fedora 17 was, that OpenJDK6 willno
longer get security updates after November 2012.
PS: Please vote up, if you liked my answer.
#update-alternatives --config java
There are 2 programs which provide 'java'.
Selection Command
-----------------------------------------------
*+ 1 /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.79-2.5.5.0.fc20.x86_64/jre/bin/java
2 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
Enter to keep the current selection[+], or type selection number: 2
# update-alternatives --config javac
There is 1 program that provides 'javac'.
Selection Command
-----------------------------------------------
*+ 1 /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.79-2.5.5.0.fc20.x86_64/bin/javac
Enter to keep the current selection[+], or type selection number:
以下为转载,主要注意安装提示“
java-1.7.0-openjdkobsoletes
java-1.6.0-openjdk”时,使用
rpm -nodeps就可以了,然后还需要:update-alternatives --config java和update-alternatives --config javac,指定1.6版本:
yum install java-1.6.0-openjdk --releasever=16 --nogpgcheck
(
--nogpgcheckbecause
yumcomplains of not having the key for Fedora 16, maybe there are better ways to solve this)
But this shows, that
java-1.7.0-openjdkobsoletes
java-1.6.0-openjdkand skips installation. And it shows that the package
xorg-x11-fonts-Type1is needed. So I did
yum install xorg-x11-fonts-Type1
and then I used the openjdk package which
yumdownloaded but refused to install because of theobsoletes warning
rpm --nodeps -ihv /var/cache/yum/x86_64/16/updates/packages/java-1.6.0-openjdk-1.6.0.0-68.1.11.5.fc16.x86_64.rpm
(
--nodepsfor overriding the obsoletes warning)
Now I have both java 1.6 and java 1.7 on my system. Java 1.7 is my default. And Java 1.6 is in
/usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java.
PS: There won't be any conflicts when you install both 1.7 and 1.6. The reason for removing 1.6 from Fedora 17 was, that OpenJDK6 willno
longer get security updates after November 2012.
PS: Please vote up, if you liked my answer.
#update-alternatives --config java
There are 2 programs which provide 'java'.
Selection Command
-----------------------------------------------
*+ 1 /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.79-2.5.5.0.fc20.x86_64/jre/bin/java
2 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
Enter to keep the current selection[+], or type selection number: 2
# update-alternatives --config javac
There is 1 program that provides 'javac'.
Selection Command
-----------------------------------------------
*+ 1 /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.79-2.5.5.0.fc20.x86_64/bin/javac
Enter to keep the current selection[+], or type selection number:
相关文章推荐
- SpringMVC返回数据方式
- java基础笔记(一--集合)
- 13.怎样自学Struts2之Struts2本地化[视频]
- paypal快速结账支付方式集成(java版)
- Java线程:线程安全类和Callable与Future(有返回值的线程)
- java web基础 --- forEach标签
- [图说Java](2)Java中字符串为什么是不可变的
- SpringMVC Controller接收前台ajax的GET或POST请求返回各种参数
- Spring配置文件详解:<context:annotation-config/>和<context:component-scan base-package=""/>和<mvc:annotation-driven />
- spring mvc下shiro的session,request等问题
- LinkedList分析
- Java的安装及环境变量的配置
- for循环中i=0与i=arr.length容易被忽视的bug
- 最大熵的Java实现
- Java多线程-并发中的集合详解
- Java多线程中异常的处理UncaughtExceptionHandler
- struts2基于xml配置方式对Action方法进行校验
- Spring之使用JDBC访问关系数据
- 分布式环境下Spark与HDFS的配置
- struts2验证框架将验证信息输出到指定位置