STEP 1:Download "jdk-1_5_0_21-linux-i586-rpm.bin" file from Java Website
Now change the permission of the downloaded file to 755 like this:chmod 755 jdk-1_5_0_21-linux-i586-rpm.bin
STEP 2:Then run it:./ jdk-1_5_0_21-linux-i586-rpm.bin
You need to type "yes" to indicate your acceptance to their agreement and the installation will complete on its own
STEP 3:Now you need to find the actual location of your JDK installation and indicate to Fedora to accept your choice.
Type the following
updatedb;locate javac grep bin
You will see an entry like this:
/usr/java/jdk1.5.0_21/bin/javac
Here /usr/java/jdk1.5.0_21 is the actual JAVA_HOME for your machine. Note this as you will need it to run the future commands.
STEP 4:
Now you need to run the alternatives command to instruct Fedora to recognize Sun's JVM
/usr/sbin/alternatives --install /usr/bin/java java /usr/java/jdk1.5.0_21/bin/java 100
/usr/sbin/alternatives --install /usr/bin/jar jar /usr/java/jdk1.5.0_21/bin/jar 100
/usr/sbin/alternatives --install /usr/bin/javac javac /usr/java/jdk1.5.0_21/bin/javac 100
STEP 5:
Finally you should configure alternative to use Sun's JVM as the default JVM. To do this type:
/usr/sbin/alternatives --config java
Select /usr/java/jdk1.5.0_21/bin/java as default
/usr/sbin/alternatives --config javac
Select /usr/java/jdk1.5.0_21/bin/javac as default
STEP 6:Add the following path in .bashrc
export PATH=$PATH:/usr/java/jdk1.5.0_21/jre/bin
Append the path in .bash_profile
/usr/java/jdk1.5.0_21/jre/bin:/usr/bin/java/jdk1.5.0_21/bin
STEP 7:Type java –version
java version "1.5.0_21"
Java(TM) 2 Runtime Environment, Standard Edition(build 1.5.0_21-b01)
Java HotSpot(TM) Server VM (build 1.5.0_21-b01, mixed mode)