Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 ?

share|improve this question

migrated from Jul 17 '12 at 21:06

This question came from our site for professional and enthusiast programmers.

up vote 1 down vote accepted
  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!

share|improve this answer
Link is broken. – merlin2011 Aug 16 '13 at 23:41

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-

(--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.

share|improve this answer

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

sudo yum install java
share|improve this answer

In my case (CentOS), I had to download it from orracle (jdk), then use rpm instead of yum. I found most of it here First I did

  rpm -ivh jdk-7u51-linux-i586.rpm

And then checked that it was installed

 /usr/java/latest/jre/bin/java -version

Then added it to alternatives

## java ##
alternatives --install /usr/bin/java java /usr/java/latest/jre/bin/java 200000
## javaws ##
alternatives --install /usr/bin/javaws javaws /usr/java/latest/jre/bin/javaws 200000

## Java Browser (Mozilla) Plugin 32-bit ##
alternatives --install /usr/lib/mozilla/plugins/ /usr/java/latest/jre/lib/i386/ 200000

## Java Browser (Mozilla) Plugin 64-bit ##
alternatives --install /usr/lib64/mozilla/plugins/ /usr/java/latest/jre/lib/amd64/ 200000

## Install javac only if you installed JDK (Java Development Kit) package ##
alternatives --install /usr/bin/javac javac /usr/java/latest/bin/javac 200000
alternatives --install /usr/bin/jar jar /usr/java/latest/bin/jar 200000

Then you have to actually set the alternatives to point to it e.g. make sure you do

 alternatives --config java
 alternatives --config javac

etc and that the new jdk is selected.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .