Java (the hard way).

Fedora doesn’t include a Java runtime, due to licensing problems, of course (if you want, you can send a mail to Sun asking them to open Java). There are other simpler ways of installing Java in Fedora, but here I’ll show the one I prefer, because you end up making an RPM with JDK (or JRE if you want), so you can install it easily into other machines and Java (and all packages) is managed by yum.

First of all we have to go to and download the jdk.nosrc file. As of this writing is java-1.5.0-sun. We download the .nosrc.rpm file.

Then we go to Sun’s page to get Java: In this page we download the JDK not the JRE (we’re going to install JDK). Click on Download JDK 5.0 Update 6.  There we accept the licence and download Linux self-extracting file (not  Linux self-extracting RPM file).

Now comes the hard part. We’re going to build JDK’s RPM. 

First of all, we must be root to do everything, so su yourself (obviously you weren’t using root as a login user, ein?).  Then, as root, copy or move the just downloaded jdk file to /usr/src/redhat/SOURCES/ .

cp jdk-1_5_0_06-linux-i586.bin /usr/src/redhat/SOURCES/

With that file in place, rebuild .nosrc.rpm file with rpmbuild:

rpmbuild –rebuild –clean java-1.5.0-sun-

If everything goes fine, you’ll have several RPMS on /usr/src/redhat/RPMS/<arch/ (on the corresponding <arch> dir). Towards the end of the output of the rpmbuild you shoud see something like:

Wrote: /usr/src/redhat/RPMS/i586/java-1.5.0-sun-
Wrote: /usr/src/redhat/RPMS/i586/java-1.5.0-sun-devel-
Wrote: /usr/src/redhat/RPMS/i586/java-1.5.0-sun-src-
Wrote: /usr/src/redhat/RPMS/i586/java-1.5.0-sun-demo-
Wrote: /usr/src/redhat/RPMS/i586/java-1.5.0-sun-plugin-
Wrote: /usr/src/redhat/RPMS/i586/java-1.5.0-sun-fonts-
Wrote: /usr/src/redhat/RPMS/i586/java-1.5.0-sun-alsa-
Wrote: /usr/src/redhat/RPMS/i586/java-1.5.0-sun-jdbc-

Then we can install them with just one command (solving dependencies on the same time):

yum localinstall /usr/src/redhat/RPMS/i586/java-1.5.0-sun-*

2 comentaris

  1. If your yum configuration (/etc/yum.conf) includes the gpgcheck=1 option, the yum localinstall command will result in the following message: <em>Package java-1.5.0-sun- is not signed</em> You must set the gpgcheck option to 0 to solve the problem.


  2. Hi, Perhaps is it a candid question but i would like to install the jdk on a intel 64 bits architecture. Do i need to choose the jdk-1_5_0_11-linux-i586.bin file or jdk-1_5_0_11-linux-amd64.bin (for Linux x64 Platform – J2SE(TM) Development Kit 5.0 Update 11)  file? Why this question because in the name of the second file i see AMD but the cpu i have is an intel CPU.Thanks in advance for your answer.Regards.


Deixa un comentari

L'adreça electrònica no es publicarà. Els camps necessaris estan marcats amb *