you can have multiple jvms on a linux box. all you need to do is to switch the path to point to the one you want to use, e.g. (bash-speak below):
export JAVA2_HOME=/usr/local/jdk1.4.8
export JAVA5_HOME=/usr/local/jdk1.5.0
export PATH=$JAVA5_HOME/bin:$PATH
two things to note:
1) you may have an /etc/profile.sh or /etc/profile.d/java.sh that sets up the jvm, so that may be where you want to make the change
2) redhat used to install a fairly old jdk by default in /usr/bin (i say 'used to' because i haven't run RH in a couple of years). so if the above stuff acts funny you can rpm-uninstall the redhat supplied one or just rename any /usr/bin/java, /usr/bin/javac, /usr/bin/jar, /usr/bin/javah etc