Print Friendly

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.

Share

About the Author

- I am a father of 3 children and in my spare time I earn a living by providing IT services and solutions for a number of companies in the electronics field. Providing solutions sounds so simple, but in practice this means doing projects under, euuhhhmmmm......., interesting conditions. (I do not think I work in the PRINCE2 understanding of a controlled environment). This triggered me to dive again in the study of the project management domain. To focus the thouhgts I am aiming for some accreditations, otherwise reading books remains scratching the surface.

2 Comments


  1. Adil
    Dec 28, 2008

    Tried this on Ubuntu 8.04 64 bit, with Eclipse 3.4 32 bit. Problem is the Java 5 installed is the 64 bit version. Is it possible to install a 32 bit version?


  2. pti
    Dec 28, 2008

    Adil,

    Personally I would get the 64-bit eclipse version which works really fine, except for the above caveat. Starting to mix and match 32-bit and 64-bit is not a path I would choose to wander.

Leave a Reply