Configuring Sun’s Java SDK for Red Hat Enterprise

For some reason Sun provide an RPM for Java which doesn’t attempt to install itself ideally for distributions like RHEL. It doesn’t put itself into the alternatives system so it can be easily switched, particularly for the Red Hat supplied tomcat5, which pulls in gcj by default.

JDK 5 lives in /usr/java/jdk1.5.0_14 after RPM installation. I’ve put in all the relevant slaves to replace the important parts of what gcj provides.

alternatives --install /usr/bin/java java /usr/java/jdk1.5.0_14/bin/java 1500 --slave /usr/bin/keytool keytool /usr/java/jdk1.5.0_14/bin/keytool --slave /usr/bin/rmiregistry rmiregistry /usr/java/jdk1.5.0_14/bin/rmiregistry --slave /usr/lib/jvm/java java_sdk /usr/java/jdk1.5.0_14 --slave /usr/bin/jar jar /usr/java/jdk1.5.0_14/bin/jar --slave /usr/bin/jarsigner jarsigner /usr/java/jdk1.5.0_14/bin/jarsigner --slave /usr/bin/javac javac /usr/java/jdk1.5.0_14/bin/javac --slave /usr/bin/rmic rmic /usr/java/jdk1.5.0_14/bin/rmic

alternatives --config java


    Leave a comment