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 Jpackage.org packages) is managed by yum.

First of all we have to go to jpackage.org 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: http://java.sun.com/j2se/1.5.0/download.jsp. 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-1.5.0.06-1jpp.nosrc.rpm

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-1.5.0.06-1jpp.i586.rpm
Wrote: /usr/src/redhat/RPMS/i586/java-1.5.0-sun-devel-1.5.0.06-1jpp.i586.rpm
Wrote: /usr/src/redhat/RPMS/i586/java-1.5.0-sun-src-1.5.0.06-1jpp.i586.rpm
Wrote: /usr/src/redhat/RPMS/i586/java-1.5.0-sun-demo-1.5.0.06-1jpp.i586.rpm
Wrote: /usr/src/redhat/RPMS/i586/java-1.5.0-sun-plugin-1.5.0.06-1jpp.i586.rpm
Wrote: /usr/src/redhat/RPMS/i586/java-1.5.0-sun-fonts-1.5.0.06-1jpp.i586.rpm
Wrote: /usr/src/redhat/RPMS/i586/java-1.5.0-sun-alsa-1.5.0.06-1jpp.i586.rpm
Wrote: /usr/src/redhat/RPMS/i586/java-1.5.0-sun-jdbc-1.5.0.06-1jpp.i586.rpm

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-*

Share and Enjoy:
  • Meneame
  • Facebook
  • LinkedIn
  • del.icio.us
  • Google Bookmarks
  • email
  • FriendFeed
  • StumbleUpon
  • Reddit
  • Tumblr
  • RSS
  • Bitacoras.com
  • PDF
  • LaTafanera
  • Ping.fm
  • BarraPunto

Related posts:

  1. Repositories
  2. Multimedia.
  3. System
  4. Multimedia
  5. Interessant: The Perils of JavaSchools – Joel on Software

About the Author