libswt-pi-gtk annoyances (in Eclipse and GWT)

What does Eclipse and Google Web Toolkit have in common? Both uses libswt-pi-gtk library. This library doesn’t work too well with Ubuntu Drapper Drake on AMD64. On Eclipse the following error would display:

libswt-pi-gtk-3235.so: cannot open shared object file: No such file or directory

When attempting to use NetBeans 5.5 rc1 with GWT NetBeans plug-in, the following error would display:

libswt-pi-gtk-3139.so: cannot open shared object file: No such file or directory

The file actually exists on the path specified by the error output. Here is a file command output:

libswt-pi-gtk-3139.so:      ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped

A Google search showed this is a known issue for Eclipse. Fortunately, I was able to start Eclipse using root and run NetBeans with GWT on an older 32-bit system.

About these ads

18 comments

  1. I’ve seen something similar when you end up running the 64-bit JVM, and there is only a 32-bit shared library. Try running the 32-bit JVM instead. (Of course, the problem might be something completely different….)

  2. > 32bit VM does help

    Wish I could say the same; I removed sun-jvm-amd64 and installed sun-jvm-i586; still have the same error

    This is killing me; trying to debug in web mode almost completly eliminates any advantage of using GWT.

  3. > I used the JDK here

    As did I. The only JDK on my machine is the 32bit version from Sun:

    pbh@lapzilla:~# java -version
    java version “1.5.0_09″
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_09-b01)
    Java HotSpot(TM) Client VM (build 1.5.0_09-b01, mixed mode, sharing)
    pbh@lapzilla:~#

  4. Okay, finally fixed.

    1. From the download page you mentioned , I grabbed the netbeans-jdk installer for Linux (not the RPM);

    2. I removed all sun-java-* packages (it game me the option of re-installing gcj-1.4 or removing open-office; I chose the former).

    aptitude purge sun-java5-doc sun-java5-jdk sun-java5-jre sun-java5-fonts sun-java5-bin

    3. I ran the installer, placing both java and netbeans in a folder within my home dir:

    /home/pbh/apps/java
    /homepbh/apps/netbeans5

    3. Then I editied netbeans.conf

    netbeans_jdkhome=”/home/pbh/apps/java”

    Then I restarted Netbeans, recompiled my GWT app and I get the GWT shell followed by my app.

    I hope the above is helpful to anyone else who has the libswt-* problem on x86_64 Ubuntu.

  5. I could not understand the process which Patrick Haggood followed. I also downloaded netbeans but how do you get library file out of it, i could not follow. If someone can elaborate a bit more on this, it will be of great help for me.

    Thanks in advance.

  6. Why do you want to “get library fie out of it”? All Patrick Haggood did was installing a non-RPM based JDK from java.sun.com, installed it, made sure no other JDK instances exists on the system (or at least not used with NetBeans), configured NetBeans to use the 32-bit JDK, started NetBeans, used GWT the same way that documentations instructed. There is no need to tweak any libraries specifically.

  7. I had same problem on opensuse 10.0 after upgrading my java to 1.5.

    I switched it back to 1.4 as follows and eclipse worked again:

    orac:~ # update-alternatives –config java

    There are 2 programs which provide `java’.

    Selection Command
    ———————————————–
    1 /usr/lib/jvm/jre-1.4.2-sun/bin/java
    *+ 2 /usr/lib64/jvm/jre-1.5.0-sun/bin/java

    Enter to keep the default[*], or type selection number: 1
    Using `/usr/lib/jvm/jre-1.4.2-sun/bin/java’ to provide `java’.

  8. A similar problem exists on Fedora with a 64 bit JRE. Actually the exception was:

    Exception in thread “main” java.lang.UnsatisfiedLinkError: /home/john/workspace/GWT/libswt-pi-gtk-3235.so: /home/john/workspace/GWT/libswt-pi-gtk-3235.so: wrong ELF class: ELFCLASS32

    which made it pretty clear the issue was a 32 bit library. Getting the x86 jdk1.6.0, pointing Eclipse at it, and setting it as the JRE solved that.

  9. I’m running netbeans 5.5 and it gives me this when I try to run GWT.

    Exception in thread “main” java.lang.UnsatisfiedLinkError: /home/dchriste/Desktop/gwt-linux-1.3.3/libswt-pi-gtk-3235.so: Can’t load this .so (machine code=0x300) on a Sparc 32-bit platform

    I have no idea how to solve this

  10. Can you run a file command on the .so file? Is it 32-bit or 64-bit? What model of SPARC machine do you have? SPARC chips have been 64-bit for a very long time. If you have a 32-bit chip, I wonder if it is a very old machine.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s