Pages

Saturday, June 2, 2012

Ubuntu 12.04 & Eclipse

I use Ubuntu at work for development, mostly with Jetbrains IntelliJ IDEA these days, I was surprised when I tried to fire up Eclipse for the first time in a while that I couldn't do so.  The error I was getting was
An error has occurred. See the log file /home/wittk/.eclipse/org.eclipse.platform_3.7.0_155965261/configuration/1338578313816.log
Here's an excerpt from the log mentioned in the message:
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/wittk/.swt/lib/linux/x86/libswt-gtk-3740.so
 Can't load library: /home/wittk/.swt/lib/linux/x86/libswt-gtk.so

The solution is to link the swt library files to the location it is looking.  This solution was mentioned here.  Just run the commands below.
cd ~/.swt/lib/linux/x86*
for file in /usr/lib/jni/libswt-*3740.so; do ln -s ${file}; done