Configuring Java on Fedora/Centos

From Klaus' wiki
Jump to: navigation, search

This describes how to configure Sun's Java to run on Fedora (and probably also Centos).

Download the latest java package from

chmod a+x <path-to-package>/jre<release>.bin
su -
cd /usr
mkdir java
cd java
ln -s /usr/java/jre<release> /usr/java/latest
alternatives --install /usr/bin/java java /usr/java/latest/bin/java 100
alternatives --install /usr/bin/javac javac /usr/java/latest/bin/javac 100
alternatives --install /usr/bin/jar jar /usr/java/latest/bin/jar 100
alternatives --install /usr/lib/mozilla/plugins/ /usr/java/latest/plugin/i386/ns7/ 100
# Configure the following to reflect your newly installed Java.
alternatives --config java
alternatives --config jar
alternatives --config javac
alternatives --config

In /etc/profile insert these two lines:

export JAVA_HOME

Check your installation

java -version

As of Firefox 3.6.something another java plugin is necessary. Use the code below to install it ( or use the alternatives way shown above ).

ln -s /usr/java/jre1.6.0_20/lib/i386/ /usr/lib/mozilla/plugins/

Restart your browser and check the plugins.