Eclipse on Ubuntu Linux for AMD64

I recently built an AMD 64-bit dual core machine, and installed Ubuntu Edgy for x86-64 on it.  One thing I found (and had read elsewhere) is that 64-bit Eclipse is buggy.  It hangs and dies usually within 30 minutes, and sometimes on a few minutes.  And I found the performance improvements to be hardly noticable, so not worth the hassle of frequent crashes.

My solution was to switch back to the 32 bit Eclipse.  Not hard, but not dirt simple.  First install the 32-bit JVM ia32-sun-java5-bin.

sudo apt-get install ia32-sun-java5-bin

At this point, you may find that the 32-bit JVM is set as your default JVM.  Not what we necessarily want to do.  Fix it thus:

 sudo update-alternatives --config java

Then choose your 64-bit JVM as the default.

Now, download the 32-bit Eclipse.  You can extract it anywhere.  I put it in my home folder under ~/Applications/eclipse32.  But, here's the problem: it won't run due to ELFCLASS32 issues because you have the 64-bit JVM on the path.  If you are like me, you try setting JAVA_HOME to point at the 32-bit JVM.  But that won't work either.  Eclipse doesn't care about JAVA_HOME.  It depends solely on finding "java" on the path.  The solution, for me, was to write a bash script called "eclipse.sh" in the eclipse32 folder as such:

 #!/bin/bash
PATH=/usr/lib/jvm/ia32-java-1.5.0-sun/bin:$PATH
/home/username/Applications/eclipse32/eclipse

You'll of course need to change the path to the eclipse binary.  Then, you need to set the executable permission:

 chmod +x eclipse.sh

Now, you should be able to run eclipse.sh and get 32-bit Eclipse, and the crashes and hangs will be a thing of the past.

  1. Mark Fortner (not verified)
    Fri, 08/17/2007 - 2:46pm
    You may have already found this, but eclipse uses a file called ~/.eclipse/eclipserc to determine where to search for Java. If you add an entry to the file that points to your $JAVA_HOME directory, Eclipse will launch with the appropriate VM.
  2. milan (not verified)
    Fri, 11/16/2007 - 2:05am
    eclipserc doesn't exist anymore in eclipse europe, so trick with shell script works for me fine. Thanks.
  3. Anonymous (not verified)
    Tue, 10/02/2007 - 9:56am
    Dan: On my widescreen laptop (1280x800), I've got Eclipse 3.2 running on Ubuntu Feisty. I haven't excercised it much yet, but my first impression is of disappointment with the amount of information shown, in comparison with what you see in Windows. The problem is the waste of space in vertical, especially in the lateral panels, tho the menu bar and the tab also take up excessive room. Screen dumps of Windows and Ubuntu are here: http://www.nabble.com/Ubuntu-fan-despairs-of-ugly-Eclipse-on-widescreen-... Apparently the problem has to do with GTK. As you are knowledgeable on the GTK, and appear also to be using Eclipse on Ubuntu, perhaps you know if there is some way to improve on things. Any help would be appreciated. thanks, Alan
  4. dmartin
    Fri, 10/12/2007 - 7:34pm

    I have two suggestions

     

    1) The biggest thing I see is that you are still using the default Gnome fonts, which are friggin huge.  The first thing I would do is switch to another font (or a smaller point size for the same font).  Set both your Application font and your Document font.  I'm particularly fond of DejaVu Sans Condensed, which is very good for fitting alot on the screen. Then in Eclipse, you need to make sure your fonts are set to System Default.  Window-Preferences-Appearance-Colors and Fonts.  Then under Basic, at the very least set Text Font and Dialog Font to System Default.  If you like your editor to be monospaced, you might manually select your Text Font to be DejaVu Sans Mono.

     

    2) The second thing I would suggest is switching to a GTK theme that is more lean.  I really love the Candido themes, which take a little work to set up.  They are very minimal on space usage, but very attractive at the same time.

  5. Jackson Chu (not verified)
    Mon, 11/12/2007 - 8:28am
    Dan, I might think running Eclipse on 64Bit more enjoyable. I setup Eclipse 64bit on my HP AMD 64X2, installed JST WST Ant Subclipse, I test it to run the Project use same machine under Vista, build time from 18 secs drop down to 10 secs, Ant task file open and build.xml open much faster than in Vista(turn off anti-virus). 1) I suggest use CentOS ( almost like Redhat Ent), Eclipse download page shows it only support AMD64 on Redhat Ent., the kernel without Xen, update the gtk,gnome and X related package. Mostly crash cause by gtk lib. 2) I suggest use Java 64 bit x86_64, this version running faster than 32bit. 3) I suggest in eclipse.ini change -Xms64m -Xmx256m to 256 - 768, will prevent crash Best, Jackson Chu
  6. Victor Kane (not verified)
    Sat, 11/17/2007 - 5:14pm

    Excellent, was able to download the latest Eclipse 3.3 Europa PDT (PHP Development Tools) using your method, on my AMD 64 install of Gutsy Gibbon. I want it to work on Drupal Development (notice you have a Drupal site).

    One additional little twist which allows me to select the JVM to use with each different install of eclipse:

    ### # executed eclipse in current dir with: # ./eclipse -vm /usr/lib/jvm/ia32-java-1.5.0-sun/jre/bin/java # or from a launcher # home/victorkane/eclipse -vm /usr/lib/jvm/ia32-java-1.5.0-sun/jre/bin/java ###

    That way you don't need a shellscript to execute it, you can put the above path into a launcher specification or menu item.

  7. Artemio Estrella (not verified)
    Sat, 03/14/2009 - 10:25am
    Thanks, In my Ubuntu is work: /home/artemio/Applications/eclipse/eclipse -vm /usr/lib/jvm/ia32-java-6-sun/jre/bin/java
  8. shahinul (not verified)
    Thu, 02/07/2008 - 5:20am
    The problem seems to be with the SUN JVM. I just installed IBM's JAVA SDK 6 and eveything works fine
  9. mayeulk (not verified)
    Wed, 03/19/2008 - 4:28am
    Yeah, it works with IBM JRE. Steps:
  10. Go to: http://www-128.ibm.com/developerworks/java/jdk/linux/download.html
  11. Choose "Java SE Version 6" "64-bit AMD/Opteron/EM64T" You must register but it is fast and free.
  12. Take this version: SDK - rpm format. File name: ibm-java-x86_64-sdk-6.0-0.0.x86_64.rpm (80.4MB)
  13. Save it where you want. Then:
  14. sudo alien -i ibm-java-x86_64-sdk-6.0-0.0.x86_64.rpm
  15. I created an eclipseibm.sh script with this:
  16. #!/bin/bash PATH=/opt/ibm/java-x86_64-60/jre/bin:$PATH /home/myname/bin/eclipse3-3-2/eclipse/eclipse chmod +x ./eclipseibm.sh
  17. So far, everything works.
  18. Frank Arnold (not verified)
    Fri, 04/11/2008 - 4:09pm
    Nice hint. I have the same problems with Hardy64 and Eclipse. The Sun 64Bit Java sucks :( The suggested switch for setting the VM is "-vm". So I start Eclipse from my panel with an entry: ~/eclipse/eclipse -vm /opt/ibm/java-x86_64-60/bin/java
  • Joe Killer (not verified)
    Tue, 03/04/2008 - 9:55pm
    I used this method to get Eclipse Europa working on my new AMD64 using Ubuntu Gutsy. The 64-bit version of Eclipse would cracsh and burn, but the 32-bit version works great with Java 6. Thanks for sharing the experience.
  • mayeulk (not verified)
    Tue, 03/18/2008 - 12:01pm
    Hi, Following the above installation procedure, the internal web browser does not work for me with eclipse 32 bits on kubuntu/ AMD 64. The external web browser neither (although it's configured). It's very annoying for looking in the language documentation (clic on a method, strike a shortcut, you have the doc, with the context depending on the class) I'm using plain eclipse with added plugins: aptana + aptana rails. Any hint? Thanks!
  • Vladimir (not verified)
    Sat, 07/12/2008 - 11:32am
    Dan, thank you very much - you saved my life :-) I have translated this article into Russian.
  • Yugan Nathan (not verified)
    Thu, 09/04/2008 - 9:13am
    Thanks bro..its workin lik charm..thx a lot!!
  • Serkan T. USLU (not verified)
    Wed, 01/14/2009 - 4:02pm
    This problem was very urgent for me and it's ok right now. Thanks a lot!