Tommy Stanton

Computer programmer and banjo picker

Getting Java to work again in Iceweasel

I am still running Debian Lenny on my little Asus 1000HD netbook (I really need to upgrade since I'm now on oldstable).

The Debian Project prefers distributing Iceweasel over Firefox in its software repositories.

One day my Java plugin was no longer working in Iceweasel, so I investigated.

Use Sun Java

First, I made sure that Sun's Java was my default (I guess it was changed at some point):

$ sudo update-alternatives --config java

There are 3 alternatives which provide 'java'.

  Selection    Alternative
          1    /usr/bin/gij-4.3
 +        2    /usr/lib/jvm/java-gcj/jre/bin/java
*         3    /usr/lib/jvm/java-6-sun/jre/bin/java

Press enter to keep the default[*], or type selection number: 3

Set the Iceweasel plugin

Alright, now to check the web browser plugins. First, let's look at the system-wide plugins:

$ cd /usr/lib/mozilla/plugins/
$ file symbolic link to
$ file /etc/alternatives/
/etc/alternatives/ symbolic link to

That looks good, it's pointing to Sun.

Maybe there's something funky in my user-specific plugin settings:

$ cd ~/.mozilla/plugins/
$ file symbolic link to

Yup is what I want, and that's set up system-wide. is not correct. Let's "delete" it and see if that fixes the browser:

$ mv /tmp/ # Temporarily get rid of this plugin

...and now Iceweasel's Java plugin magically works again. I'll just let that symlink sit in /tmp/ until I shut down my laptop and it is automatically deleted. >=D


I believe that the culprit, the symlink in ~/.mozilla/plugins/, was created by dpkg when I upgraded Sun's Java sometime in the last month.

$ sudo zgrep sun\-java /var/log/dpkg* | grep install | grep -v half \
| less -S
/var/log/dpkg.log:2011-10-04 02:07:05 install sun-java6-plugin <none> 6-26-0lenny1
/var/log/dpkg.log:2011-10-04 02:07:08 status installed sun-java6-plugin 6-26-0lenny1
/var/log/dpkg.log.1:2011-10-01 21:19:52 status installed sun-java6-bin 6-26-0lenny1
/var/log/dpkg.log.1:2011-10-01 21:19:59 status installed sun-java6-jdk 6-26-0lenny1
/var/log/dpkg.log.1:2011-10-01 21:20:00 status installed sun-java6-jre 6-26-0lenny1
/var/log/dpkg.log.11.gz:2010-12-05 19:51:07 status installed sun-java6-bin 6-22-0lenny1
/var/log/dpkg.log.11.gz:2010-12-05 19:51:15 status installed sun-java6-jdk 6-22-0lenny1
/var/log/dpkg.log.11.gz:2010-12-05 19:51:16 status installed sun-java6-jre 6-22-0lenny1
blog comments powered by Disqus