Note:Some visitors have reported errors following these steps. Please see the comments at the bottom of the page
before proceeding. I would recommend testing this in a Virtual Environment using any Virtualization software such as SWSoft's Virtuozzo, Microsoft Virtual Server 2003 R2 SP1, VMWare, etc. You have been warned!
The following describes my successful installation of the following applications on a CentOS 4.4 virtual environment running under Virtuozzo 3.0.0:
JRE 1.5.0 Update 11
JDK 1.5.0 Update 11
Tomcat 5.5.20
Postgresql 7.4.16
rrdtool 1.2.18
OpenNMS 1.3.2
Install Java: Head on over to
http://java.sun.com and download JRE & JDK 5. You'll need at least
JDK 5.0 & JRE 5.0 Update 6 (I assume earlier and later versions work - I just happened to use these).
Download the files to any directory you like. I personally prefer /usr/local/src/
# mkdir /usr/local/java
# cd /usr/local/src
# cp jdk-1_5_0_11-linux-i586.bin /usr/local/java
# cp jre-1_5_0_11-linux-i586.bin /usr/local/java
# cd /usr/local/java // (UPDATE!)
# chmod +x j*.bin
# ./jdk-1_5_0_11-linux-i586.bin
...
Creating jdk1.5.0_11/jre/lib/jsse.jar
Creating jdk1.5.0_11/jre/lib/charsets.jar
Creating jdk1.5.0_11/jre/lib/ext/localedata.jar
Creating jdk1.5.0_11/jre/lib/plugin.jar
Creating jdk1.5.0_11/jre/lib/javaws.jar
Creating jdk1.5.0_11/jre/lib/deploy.jar
Done.
# ./jre-1_5_0_11-linux-i586.bin
linking: jre1.5.0_11/javaws/javaws -> ../bin/javaws
Creating jre1.5.0_11/lib/rt.jar
Creating jre1.5.0_11/lib/jsse.jar
Creating jre1.5.0_11/lib/charsets.jar
Creating jre1.5.0_11/lib/ext/localedata.jar
Creating jre1.5.0_11/lib/plugin.jar
Creating jre1.5.0_11/lib/javaws.jar
Creating jre1.5.0_11/lib/deploy.jar
Done.
# chown -R root:root jdk1.5.0_11
# chown -R root:root jre1.5.0_11 // I had a typo here.
# ln -s jdk1.5.0_11 j2sdk
# ln -s jre1.5.0_11 j2jre // I hade a typo here too!
Here's what the directory looks like:
[root@opennms java]# pwd
/usr/local/java
[root@opennms java]# ls -FGg
total 65216
lrwxrwxrwx 1 11 Apr 20 12:35 j2jre -> jre1.5.0_11/
lrwxrwxrwx 1 11 Apr 20 12:34 j2sdk -> jdk1.5.0_11/
-rwxr-xr-x 1 49574613 Apr 20 12:22 jdk-1_5_0_11-linux-i586.bin*
drwxr-xr-x 9 4096 Dec 15 04:36 jdk1.5.0_11/
-rwxr-xr-x 1 17115102 Apr 20 12:22 jre-1_5_0_11-linux-i586.bin*
drwxr-xr-x 7 4096 Dec 15 04:34 jre1.5.0_11/
Continuing on...
# rm *.bin
# vi /etc/profile
In /etc/profile, look for:
if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
INPUTRC=/etc/inputrc
fi
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC
Between it (above "export" and below "fi"), add: