The quickest way to install Sun’s JDK on a Red Hat machine

Scott StultsFebruary 25, 2008

For various reasons I inevitably need to install Sun’s JDK on a Red Hat-based machine. If you’ve done this, you know that Java’s 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, I’ll 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 you’re using something like RHEL4 you’ll need to install Java from Sun’s 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



More blog articles:


Let's do a project together!

We provide tailored search, discovery and personalization solutions using Solr and Elasticsearch. Learn more about our service offerings