Blog

The quickest way to install Suns JDK on a Red Hat machine

For various reasons I inevitably need to install Suns JDK on a Red Hat-based machine. If youve done this, you know that Javas related files are managed by the **alternatives **system. I used to simply ignore that fact and rewrite the links manually; a PITA to say the least, but it saved me from Reading The Fine Manpage on **alternatives **and numerous attempts at getting the commands right.

After a bit of Googling I ran across this great reference which describes what should be the definitive guide. For the impatient, Ill summarize the exact steps here:

rpm --import http://jpackage.org/jpackage.asc
cd /etc/yum.repos.d/
wget http://www.jpackage.org/jpackage17.repo
yum --enablerepo=jpackage-generic-nonfree install java-1.6.0-sun-compat.i586

[addendum on 03/05/08]

Actually, that last line will only work on a Fedora box. If youre using something like RHEL4 youll need to install Java from Suns site, then yum, then you can yum the compat package:

rpm -ivh ftp://rpmfind.net/linux/dag/redhat/el4/en/i386/dag/RPMS/sqlite-2.8.17-1.el4.rf.i386.rpm
rpm -ivh ftp://rpmfind.net/linux/dag/redhat/el4/en/i386/dag/RPMS/python-elementtree-1.2.6-7.el4.rf.i386.rpm
rpm -ivh ftp://rpmfind.net/linux/dag/redhat/el4/en/i386/dag/RPMS/python-sqlite-1.0.1-1.2.el4.rf.i386.rpm
rpm -ivh ftp://rpmfind.net/linux/dag/redhat/el4/en/i386/dag/RPMS/python-urlgrabber-2.9.7-1.2.el4.rf.noarch.rpm
rpm -ivh http://dag.wieers.com/rpm/packages/yum/yum-2.4.2-0.4.el4.rf.noarch.rpm