How to install jdk with yum on Fedora 17?

16,407

Solution 1

  1. Download the last JDK version here: Java SE Development Kit 7 Downloads
  2. Choose the version jdk-7u5-linux-x64.rpm (the last one!) (*.rpm is the important here!) and then just type:

    user@machine#: yum localinstall jdk-7u5-linux-x64.rpm
    

And that is it!

Solution 2

If you really want version 1.6 of OpenJDK for Fedora 17 you could use the one provided by Fedora 16. Use this command:

yum install java-1.6.0-openjdk --releasever=16 --nogpgcheck

(--nogpgcheck because yum complains of not having the key for Fedora 16, maybe there are better ways to solve this)

But this shows, that java-1.7.0-openjdk obsoletes java-1.6.0-openjdk and skips installation. And it shows that the package xorg-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 the obsoletes 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

(--nodeps for 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 will no longer get security updates after November 2012.

Solution 3

Type the following in a command prompt to install the latest version:

sudo yum install java
Share:
16,407

Related videos on Youtube

Jason
Author by

Jason

Updated on September 18, 2022

Comments

  • Jason
    Jason almost 2 years

    I want to install jdk by yum on Federa 17 and using :

    su -c 'yum install java-1.6.0-openjdk'
    

    But it show "no available package". How can I do to install it ?

  • merlin2011
    merlin2011 almost 11 years
    Link is broken.
  • Richard T
    Richard T almost 6 years
    I'm sorry, but TODAY, with Fedora 28, THIS DOES NOT WORK! Running the modern equivalent installs something called a JDK but it DOES NOT HAVE "javac"! WTF?! That's why I came to ask this question: How The Heck Do I Get A REAL JDK?