Back

Installing Sun's JDK on a Linux (Fedora 7) system

These are the instructions to install JDK on a Fedora 7 system. Other Linux distributions may have different instructions to install Sun's JDK. Consult your distribution's documents.

First get the latest version from http://java.sun.com. Download the "Linux self extracting file" not the rpm package. After download, become root, move the file to /opt

mv jdk-6u2-linux-i586.bin /opt
change directory to /opt
cd /opt
make the file executable,
chmod +x jdk-6u2-linux-i586.bin
and execute the program
./jdk-6u2-linux-i586.bin
After install succeds, you should tell your system that the Sun's JDK/JRE is your primary java platform, not the gcc-java which is the default package in Fedora 7. Create a symbolic link
ln -s jdk1.6.0_02 jdk1.6
install the new JDK as java alternatives
/usr/sbin/alternatives --install /usr/bin/java java /opt/jdk1.6/bin/java 2 --slave /usr/bin/javac javac /opt/jdk1.6/bin/javac --slave /usr/bin/javadoc javadoc /opt/jdk1.6/bin/javadoc --slave /usr/bin/jar jar /opt/jdk1.6/bin/jar --slave /usr/bin/javaws javaws /opt/jdk1.6/bin/javaws
configure the java alternatives
/usr/sbin/alternatives --config java
choose the newly installed JDK as the primary choice. Check the alternatives to java
/usr/sbin/alternatives --display java
Because of the symbolic link you created above, you don't need to install new alternatives each time you install an update to JDK/JRE. Simply remove the old link and establish a new one pointing to the most recent jdk you downloaded.

For browser (firefox) plugins to work, do the following as root

ln -s /opt/jdk1.6/jre/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins/libjavaplugin_oji.so
Important Note: Java and 3D desktop managers (Compiz and Beryl on Fedora 7 and other distributions) do not work very welll together. This is true for both Java Applets and Applications, including Full Screen Exclusive Mode. Continue using Metacity Window Manager (default window manager on Fedora 7) for now. This is a known problem.


  Back