My Ubuntu Experience: Java

November 15, 2006 – 01:58 | Ubuntu | Tags: , , , ,

I'll catch up later the couple of "episodes" which I'm skipping over and jumping to the Java set up part. Ubuntu comes with gcj and other GNU-based java facilities, which mostly are still only equivalent to JDK 1.4.x. So they needed to get chucked right away, and replaced with the Sun JDK 5. It's pretty straightforward to install JDK 5, Eclipse, and the rest of the arsenal I work with on the daily basis. The only part involving manual setting was when enabling the Java Plugin and Web Start in Firefox. Here's The Plugin Portion of it.

The highlight of this would-have-been-mundane process was Web Start, according to the JDK installation notes, it's supposed to get set up automatically by the installer, which is kind of true, as I could see all the relevant entries being added properly into /etc/mailcap and /etc/mime.types. Yet, when I tried to Web Start an application, Firefox always downloads it and offers to handle it by downloading it again and offering to handle it by downloading it again and offering to handle it... :) And the Preferences->Content->File Types->Manage thingy drove me crazy because there didn't seem to be any way to add a new type.

The trick, I finally figured out, is to open up a File Browser, right click on a JNLP file, choose "Properties", then the "Open With" tab, and add the path to javaws in there, and make it the default open application.

Update:
To make the Sun JDK an alternative in the Debian alternatives system, simply do (assuming JDK 1.6 installation path /opt/jdk1.6/bin/java):

CODE:
  1. sudo update-alternatives --install /usr/bin/java java /opt/jdk1.6/bin/java 60

This makes /usr/bin/java link to the JDK 1.6 version. This works system-wide, compared to simply adding /opt/jdk1.6/bin to $PATH. Also you can have other versions JDK 1.5 added, and then use update-alternatives to easily switch back and forth between the two.

Trackback from your site, or follow the comments in RSS.

Post a Comment