Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I upgraded to the 12.04 beta yesterday. Now, when I try to start Eclipse, I get the splash screen and then this error message:

An error has occurred. See the log file /home/gabriel/.eclipse/org.eclipse.platform_3.7.0_155965261/configuration/1335382319394.log .

The log file says something like this:

java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
    no swt-gtk-3740 in java.library.path
    no swt-gtk in java.library.path
    Can't load library: /home/gabriel/.swt/lib/linux/x86_64/libswt-gtk-3740.so
    Can't load library: /home/gabriel/.swt/lib/linux/x86_64/libswt-gtk.so

followed by many more error messages.

The /home/gabriel/.swt/lib/linux/x86_64/ directory exists, but is empty. I also tried reinstalling eclipse with no success.

Any ideas?

share|improve this question
    
This is a bug. Please log into Launchpad and register that this also affects you: bugs.launchpad.net/ubuntu/+source/eclipse/+bug/989615 –  David Edwards May 25 '12 at 10:59
add comment

6 Answers 6

up vote 17 down vote accepted

I have got the same issue in an AMD64 machine (Ubuntu 12.04). and solved it by a workaround:

copy: files containing '3740' in /usr/lib/jni/libswt-*3740.so to ~/.swt/lib/linux/x86_64/

But, be sure the packages : libswt-gtk-3-java & libswt-gtk-3-jni are installed.

sudo apt-get install libswt-gtk-3-jni libswt-gtk-3-java

And

sudo cp /usr/lib/jni/libswt-*3740.so ~/.swt/lib/linux/x86_64/

if you have a 32 bits based system : sudo cp /usr/lib/jni/libswt-*3740.so ~/.swt/lib/linux/x86/

share|improve this answer
1  
wow this actually worked for me too (Intel core i5, 64 bit ubuntu 12.04) thanks a lot! –  vallllll May 1 '12 at 9:57
1  
Worked great for a 32-bit system. Using: sudo cp /usr/lib/jni/libswt-*3740.so ~/.swt/lib/linux/x86/ . Thanks and update your answer please. –  Binarylife May 3 '12 at 9:24
1  
It really works for me either (Ubuntu precise 64 bit). I had created soft links instead of copy. –  masuch May 4 '12 at 23:11
add comment

Try running

sudo update-alternatives --config java

and selection open jdk. This would probably work.

share|improve this answer
    
This did work, but I'm trying to avoid using openjdk. –  Keidax Apr 25 '12 at 19:58
    
Actually, never mind. I'll just go with it. –  Keidax Apr 26 '12 at 1:58
1  
I also wanted to avoid openjdk, so check out Hanynowsky's answer; it worked for me! –  nbadal May 2 '12 at 22:34
add comment

I made symlinks to the missing libs and everything worked fine. It ended up looking like this...

    libswt-atk-gtk-3740.so -> /usr/lib/jni/libswt-atk-gtk-3740.so
    libswt-gtk-3740.so -> /usr/lib/jni/libswt-gtk-3740.so
    libswt-pi-gtk-3740.so -> /usr/lib/jni/libswt-pi-gtk-3740.so

Seems to work.

share|improve this answer
add comment

Also for me it works; I done:

cd ~/.swt/lib/linux/x86_64
ln -s /usr/lib/jni/libswt-atk-gtk-3740.so
ln -s /usr/lib/jni/libswt-gtk-3740.so
ln-s /usr/lib/jni/libswt-pi-gtk-3740.so

and so, I created 3 symlink in the folder ~/.swt/lib/linux/x86_64

Now Eclipse works fine!

share|improve this answer
add comment

Thanks for the great instructions. I added symlinks like this instead, to make sure it picks up all 3740:

cd ~/.swt/lib/linux/x86_64

for i in /usr/lib/jni/*3740*.so ; do ln -s $i; done
share|improve this answer
add comment
echo "-Djava.library.path=/usr/lib/jni" >> /etc/eclipse.ini

fixed it for me.

share|improve this answer
    
Love this solution, fixed it for all users. –  Adam N Aug 11 '12 at 19:08
add comment

protected by Community Oct 21 '12 at 8:07

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.