Ubuntu: Unsatisfied Link Error and missing .so files when starting Eclipse


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?


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  


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/


Try running

sudo update-alternatives --config java

and selection open jdk. This would probably work.


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!


echo "-Djava.library.path=/usr/lib/jni" >> /etc/eclipse.ini  

fixed it for me.


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  


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.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »