In general, I don’t really care for Java. I think it’s slow, clunky, ugly … and, well, you get the picture. But even though Java may not be my favorite computer language, I do recognize a fundamental reality: it’s a pretty essential component of any operating system, especially on Linux.
The amount of stuff that requires Java is absolutely staggering, and you don’t begin to really appreciate how important Java is until it stops working. Which brings me to the main point of this posting, it seems like every time I upgrade my Ubuntu distribution, it wants to stop working. Unfortunately, my recent upgrade to Ubuntu 10.04 was no exception.
Now – in an ironic turn of fate — I actually understand the reason for that Java breaks whenever you upgrade to the newest version of Ubuntu. From an ideological standpoint, I even agree with it; somewhat. But consciously appreciating the rationale behind something and having to clean up its mess are two very different things; and I dislike adjusting my daily routine because of ideology.
Here’s the problem. Ubuntu, like most Linux operating systems, strives to be Open Source. As I said, part of the reason for this is ideological — Ubuntu wants to include only the best Open software available – but part of it is also practical and legal, meaning that any GPL software package more or less requires that related software also be GPL. And therein lies the problem with Java, and why it seems to break every time you update to a new version of Ubuntu.
There isn’t just one version of Java. Really, there are two.
One is the Java VM, distributed by Sun Microsystems (now Oracle), that you’ve come to appreciate and love on every major platform. Even though it is everywhere, the Oracle version of Java isn’t completely Pure; and for that reason, a few narrow minded zealots individuals feel that it shouldn’t be included in Ubuntu by default.
The other Java version, in contrast, is a true open source implementation that doesn’t require you to give up any of your free-software rights. I’ll refer to it as Open-Java. As I said above, there are good ideological reasons to support and use Open-Java. But even so, there is also a big technological reason not to: they haven’t quite ironed out the kinks yet.
Every time I upgrade Ubuntu, I have high hopes for Open-Java. And every time I upgrade Ubuntu, I re-learn my lesson: Open-Java is still not ready for prime time. This morning, I learned it in particularly painful fashion while trying to finish a chapter in my book on the Zotero Cite-While-You-Write plug-in.
After performing flawlessly for months (nearly seven of them, in fact); the plug-in simply refused to work. I would Open Zotero in Firefox, and that worked fine. Then, I would launch OpenOffice Writer, and that would work too. But when I tried to insert a new citation, my computer would beep and say, “Unable to connect.”
What the hell?
This was very frustrating to me. Unable to connect to what? OpenOffice was running and working. Zotero was running and working. There shouldn’t be a problem. Yet, there was.
I’m a control freak. Random breakages annoy and anger me, and this particular breakage was absurdly frustrating because Zotero had worked just fine the previous week, prior to upgrading to Ubuntu 10.04
Now, at the time, I had absolutely no idea what was wrong. I hadn’t yet realized that Canonical, in the interests of ideological purity, had replaced my carefully installed Sun Java with the Open-Java implementation.
Therefore, I turned to the Great Oracle of Google; and I it was there that I discovered the answer: my Java installation wasn’t working correctly. Ah, Java. Bane of my existence and annoyance of my computing. As I said, I’ve been here before; twice actually. When I upgraded to Ubuntu 9.10, and when upgrading to Ubuntu 9.04 before that. You’d think I would keep better notes.
But, at least I’m not the only one. So far, I’ve received two different emails from others having the very same problem. Which is why I’m writing this blog post.
Should you find that your Java programs have stopped working, here are the steps needed to fix it.
- Enable the Ubuntu partners repository.
- Next, install the java-virtual machine package and browser plug-in.
- Finally, set the Sun Java Machine as the default.
Here’s what it looks like from the command line:
sudo apt-get install sun-java6-jre sun-java6-jre-plugin
sudo update-java-alternatives –s java-6-sun
And as far as Canonical is concerned: please only make upgrades to my system that improve the user experience. I dislike having to fix things. I would much rather focus on my work. To say this actually pains me, because, for the most part, Ubuntu offers the best “It Just Works” experience of any of the major operating systems. So, Canonical, why would you do anything to screw that up?
Note: The Java icon used for this post was adapted from Java $PSD by VSX47.