How to install OpenJDK 21 and 22 23 in Fedora 17 18 19 20 1.6 1.7 1.8 system Coexistence

Source: Internet
Author: User

First of all, in the high fedora, there is no java-openjdk-1.6 package that needs to be downloaded online, such as CentOS java-openjdk-1.6 package in 7: java-1.6.0-openjdk-1.6.0.36-1.13.8.1.el7_1.x86_64.rpm, measured can be installed in Fedora 20.

The following is reproduced, the main note installation prompts "Java-1.7.0-openjdk obsoletes java-1.6.0-openjdk", the use of rpm-nodeps can, and then also need: update-alternatives- Config Java and update-alternatives--config Javac, specifying version 1.6:

Yum Install java-1.6.0-openjdk--releasever=16--nogpgcheck

(--nogpgcheck because Yum complains of not have the key for Fedora, maybe there are better to ways this)

But This shows, that java-1.7.0-openjdk obsoletes java-1.6.0-openjdk and skips. And it shows that's the packagexorg-x11-fonts-type1 is needed. So I did

Yum Install Xorg-x11-fonts-type1

And then I used the OPENJDK package which Yum downloaded but refused to install because of theobsoletes

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

(--nodeps for overriding the obsoletes warning)

Now I have both Java 1.6 and Java 1.7 in 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 to you install both 1.7 and 1.6. The reason for removing 1.6 from Fedora is, that OpenJDK6 willno longer get security updates after November 2012.

Ps:please vote up, if your 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:  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.