Kubuntu and a slow Eclipse

You know you want to do it, the move, from windows to Linux when developing locally. It works like a charm, except for Eclipse when you do not pay attention.

One could wonder, why do you want to develop locally? Well, sometimes (twice a day) I travel by train. And sitting still is very hard for me (tend to get bored easily) and thus I wanted to be able to do some work in that time. When you do not have a 24×7 UMTS high speed internet connection (or alike) you just have to do it sometimes.

This is where Linux plays an important part, in linux you can simulate your production environment as closely as possible to make deployments and or exchanges as painless as possible.
Unfortunately Eclipse tends to grind to a halt when you want to do anything more complicated then typing.
Fortunately, there is a fix!

First of all, install Eclipse (I advise the downloadable version with PDT included because the Aptitude version of Eclipse is one number behind (3.2) and PDT 1.x won’t run on it (hasn’t got WST 2.0.0 or higher).
When done, get the Java Sun 6 package from Aptitude with the following command:
sudo apt-get install sun-java6-bin sun-java6-jdk sun-java6-jre
Did it? Good!

Unfortunately Linux might not understand you actually want this to be your default JVM so you need to edit /etc/jvm and type the path where your JRE is installed at the top of the list (usually this is /usr/lib/jvm/java-6-sun
sudo nano /etc/jvm
In some case Eclipse does not dig it either (annoying, is it not?) and you can force Eclipse as well to use your new Sun JVM by placing the path in the /etc/eclipse/java_home file (or wherever your eclipse installation path is)
sudo nano /etc/eclipse/java_home
Last but not least: tell your linux version to use this JVM with the following command:
sudo update-java-alternatives --set java-6-sun
After this, your eclipse (and other Java applications) will work like never before!!

Leave a Reply

Your email address will not be published. Required fields are marked *