2008年3月30日星期日

Install Sun's JDK on Fedora 8

1. Download the Linux self extracting rpm version of JDK from Sun's website.
Let say the rpm name is jdk-6u5-linux-i586-rpm.bin

2. Launch your terminal. Install the following library modules needed by Sun Java.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# yum -y install compat-libstdc++-33 compat-libstdc++-296

2. Fire up the console and change directory to where the downloaded rpm is located

3. Change to root by using su and enter your root's password

4. Change the permission of the file by using chmod 755 jdk-6u5-linux-i586-rpm.bin

5. Run the file using the command ./jdk-6u5-linux-i586-rpm.bin

6. Scroll all the way down and enter yes

7. Next, enter updatedb; locate javac |grep bin
It will show you a path to the newly installed Sun's JDK.

8. Next, run these commands
/usr/sbin/alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_05/bin/java 100
/usr/sbin/alternatives --install /usr/bin/jar jar /usr/java/jdk1.6.0_05/bin/jar 100
/usr/sbin/alternatives --install /usr/bin/javac javac /usr/java/jdk1.6.0_05/bin/javac 100

9. Lastly, to change the default JVM from gcj to Sun's version, run this command
/usr/sbin/alternatives --config java
Select the one that is from Sun and that's it!