Get jpackage-utils. You cannot install java without installing jpackage-utils.
wget http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/jpackage-utils-1.7.3-1jpp.1.el4.noarch.rpm
If the link above doesn't work, search for jpackage in
http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/
and get that rpm.
Install
rpm -U jpackage-utils-1.7.3-1jpp.1.el4.noarch.rpm
If the above doesn't work, see section below about installing using yum.
Now we need two things, Java installer and a compat rpm.
You get the Java installer from Sun's website. You will need to use your browser for this and somehow move them to your dv. Make sure you get the rpm version.
You should get a file like this: jdk-6u2-linux-i586-rpm.bin
Execute it.
./jdk-6u2-linux-i586-rpm.bin
You can get the compat from:
ftp://jpackage.hmdc.harvard.edu/JPackage/1.7/generic/RPMS.non-free/
Since I am installing JDK 1.6.0_2, I'll run
wget ftp://jpackage.hmdc.harvard.edu/JPackage/1.7/generic/RPMS.non-free/java-1.6.0-sun-compat-1.6.0.02-1jpp.i586.rpm
and then
rpm -U java-1.6.0-sun-compat-1.6.0.02-1jpp.i586.rpm
---------------------------------------------
INSTALL jpackage-utils using yum
I do not know if this is necessary. It just happen to be how I install jpackage-utils. If you are having issue install jpackage-utils, you might want to try this method.
First get/update your yum.
Login as root
wget http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/yum-2.4.3-3.el4.centos.noarch.rpm
If not found, go to http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/ and look for latest yum rpm.
Install/upgrade yum
rpm -U yum-2.4.3-3.el4.centos.noarch.rpm
It might complain about dependencies, get them from http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/ and run rpm -U on each dependencies.
If it complains about dependencies: libsqlite3.so.0, get
http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/sqlite-3.3.6-2.i386.rpm
After you are done with yum install, let's use it.
yum install yum-utils
yum install jpackage-utils