Eclipse Ganymede crashes on 64-bit Ubuntu Hardy Herron

2 min 347 words
Peter Tillemans Profile picture

Categories: programming

Tags: jvm

In java6 there is a bug in the 64-bit linux version of the jvm which causes eclipse to crash when opening projects with some aditional plugins installed. Both the openjdk as the sun versions are affected. for more info see :

In the mean time this has been fixed in openjdk7, but this might take a while before this shows up in the repositories. In the mean time the jdk5 does not have this problem and works perfectly well with eclipse. So a quick

sudo aptitude install sun-java5-jdk

installs the needed software. However if the java6 is still installed, chances are it will be preferred over the java5 version of the programs. There are 2 ways to make sure eclipse uses java5 Use java5 for ALL programs. To change the preference tell the alternatives system to use the java5 version.

pti@pti-laptop:~$ **sudo update-alternatives --config java**
\[sudo\] password for pti: 

There are 3 alternatives which provide `java'.

 Selection    Alternative
-----------------------------------------------
          1    /usr/lib/jvm/java-6-sun/jre/bin/java
          2    /usr/lib/jvm/java-1.5.0-sun/jre/bin/java 
       \*  3    /usr/lib/jvm/java-6-openjdk/jre/bin/java

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

Using '/usr/lib/jvm/java-1.5.0-sun/jre/bin/java' to provide 'java'. 

To choose the alternatives with a GUI it is a good idea to install galternatives. Tell only eclipse to use java5. Since the bug only shows up on my system (so far) in eclipse, I prefer the speedier java6 as default. Luckiliy we can tell eclipse to use a specific jvm in the eclipse.ini file. Open eclipse.ini in your eclipse home with your favorite editor and add the following 2 lines to the beginning of the file

 -vm
    /usr/lib/jvm/java-1.5.0-sun/jre/bin/java

This will tell the eclipse launcher to use java5 to launch eclipse.