19 August, 2008

Getting Sun's JDK working right in Fedora

This should be an easy task, right? Just download the RPM, install it, done and done. Right? Well, no, not quite.

I've managed to whip up a couple commands that help with the post-install though. Namely, overriding all of the various symlinks throughout the system to IcedTea and GCJ. Here, for your viewing and usage pleasure, is what I have come up with. Please feel free to emend where you deem appropriate, and please let me know if I am missing things!

alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_07/bin/java 20000 --slave /usr/bin/keytool keytool /usr/java/jdk1.6.0_07/bin/keytool --slave /usr/bin/orbd orbd /usr/java/jdk1.6.0_07/bin/orbd --slave /usr/bin/pack200 pack200 /usr/java/jdk1.6.0_07/bin/pack200 --slave /usr/bin/policytool policytool /usr/java/jdk1.6.0_07/bin/policytool --slave /usr/bin/rmid rmid /usr/java/jdk1.6.0_07/bin/rmid --slave /usr/bin/rmiregistry rmiregistry /usr/java/jdk1.6.0_07/bin/rmiregistry --slave /usr/bin/servertool servertool /usr/java/jdk1.6.0_07/bin/servertool --slave /usr/bin/tnameserv tnameserv /usr/java/jdk1.6.0_07/bin/tnameserv --slave /usr/bin/unpack200 unpack200 /usr/java/jdk1.6.0_07/bin/unpack200 --slave /usr/lib/jvm/jre jre /usr/java/jdk1.6.0_07/jre

alternatives --install /usr/bin/javac javac /usr/java/jdk1.6.0_07/bin/javac 20000 --slave /usr/bin/appletviewer appletviewer /usr/java/jdk1.6.0_07/bin/appletviewer --slave /usr/bin/apt apt /usr/java/jdk1.6.0_07/bin/apt --slave /usr/bin/extcheck extcheck /usr/java/jdk1.6.0_07/bin/extcheck --slave /usr/bin/jar jar /usr/java/jdk1.6.0_07/bin/jar --slave /usr/bin/jarsigner jarsigner /usr/java/jdk1.6.0_07/bin/jarsigner --slave /usr/bin/javadoc javadoc /usr/java/jdk1.6.0_07/bin/javadoc --slave /usr/bin/javah javah /usr/java/jdk1.6.0_07/bin/javah --slave /usr/bin/javap javap /usr/java/jdk1.6.0_07/bin/javap --slave /usr/bin/jconsole jconsole /usr/java/jdk1.6.0_07/bin/jconsole --slave /usr/bin/jdb jdb /usr/java/jdk1.6.0_07/bin/jdb --slave /usr/bin/jhat jhat /usr/java/jdk1.6.0_07/bin/jhat --slave /usr/bin/jinfo jinfo /usr/java/jdk1.6.0_07/bin/jinfo --slave /usr/bin/jmap jmap /usr/java/jdk1.6.0_07/bin/jmap --slave /usr/bin/jps jps /usr/java/jdk1.6.0_07/bin/jps --slave /usr/bin/jrunscript jrunscript /usr/java/jdk1.6.0_07/bin/jrunscript --slave /usr/bin/jsadebugd jsadebugd /usr/java/jdk1.6.0_07/bin/jsadebugd --slave /usr/bin/jstack jstack /usr/java/jdk1.6.0_07/bin/jstack --slave /usr/bin/jstat jstat /usr/java/jdk1.6.0_07/bin/jstat --slave /usr/bin/jstatd jstatd /usr/java/jdk1.6.0_07/bin/jstatd --slave /usr/bin/native2ascii native2ascii /usr/java/jdk1.6.0_07/bin/native2ascii --slave /usr/bin/rmic rmic /usr/java/jdk1.6.0_07/bin/rmic --slave /usr/bin/schemagen schemagen /usr/java/jdk1.6.0_07/bin/schemagen --slave /usr/bin/serialver serialver /usr/java/jdk1.6.0_07/bin/serialver --slave /usr/bin/wsgen wsgen /usr/java/jdk1.6.0_07/bin/wsgen --slave /usr/bin/wsimport wsimport /usr/java/jdk1.6.0_07/bin/wsimport --slave /usr/bin/xjc xjc /usr/java/jdk1.6.0_07/bin/xjc --slave /usr/lib/jvm/java java_sdk /usr/java/jdk1.6.0_07
You may notice that I did not include the manpages in these alternatives definitions. This was intentional... because alternatives is looking for gzips and the JDK, by default, does not gzip them. Whatever. I leave that as an exercise for the user. I just didn't feel like bothering, myself. :)

No comments: