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

Anuncis
Comentaris
  1. David Barroso ha dit:

    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-1.5.0.09-1jpp.i586.rpm is not signed</em> You must set the gpgcheck option to 0 to solve the problem.

  2. remarde78 ha dit:

    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

Fill in your details below or click an icon to log in:

WordPress.com Logo

Esteu comentant fent servir el compte WordPress.com. Log Out / Canvia )

Twitter picture

Esteu comentant fent servir el compte Twitter. Log Out / Canvia )

Facebook photo

Esteu comentant fent servir el compte Facebook. Log Out / Canvia )

Google+ photo

Esteu comentant fent servir el compte Google+. Log Out / Canvia )

Connecting to %s