Zied Nouira Blog Something in my mind…

13Oct/095

Working with GWT on Ubuntu 9

It's will be simple to start the example project. expect that there's some things to do to run hosted mode.

Running the web application will give you an error like this :

** Unable to load Mozilla for hosted mode **
java.lang.UnsatisfiedLinkError: .../eclipse/plugins/com.google.gwt.eclipse.sdkbundle.linux_.../gwt-linux-2.0/mozilla-1.7.12/libxpcom.so: libstdc++.so.5: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1778)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1674)
at java.lang.Runtime.load0(Runtime.java:770)
at java.lang.System.load(System.java:1003)
at com.google.gwt.dev.shell.moz.MozillaInstall.load(MozillaInstall.java:190)
at com.google.gwt.dev.BootStrapPlatform.initHostedMode(BootStrapPlatform.java:53)
at com.google.gwt.dev.HostedModeBase.(HostedModeBase.java:434)
at com.google.gwt.dev.SwtHostedModeBase.(SwtHostedModeBase.java:162)
at com.google.gwt.dev.HostedMode.(HostedMode.java:282)
at com.google.gwt.dev.HostedMode.main(HostedMode.java:241)

This is due that the libstdc++5 is missing from your Ubuntu.

Usually an update thorough apt-get can save

sudo apt-get install libstdc++5

but you can get this message

Package libstdc++5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package libstdc++5 has no installation candidate

Then you will have to get the libstdc++5 manually like this

# change directory to /tmp directory:
cd /tmp/

# download deb package:
wget -c http://lug.mtu.edu/ubuntu/pool/main/g/gcc-3.3/libstdc++5_3.3.6-10_i386.deb

# unpack deb package to get library file
dpkg -x libstdc++5_3.3.6-10_i386.deb libstdc++5

# copy library file to /usr/lib directory
sudo cp libstdc++5/usr/lib/libstdc++.so.5.0.7 /usr/lib

# change directory to /usr/lib directory
cd /usr/lib

# create a link to library
sudo ln -s libstdc++.so.5.0.7 libstdc++.so.5

Now you will be able to run the hosted mode.
If you are using a 64bit linux you have to copy to /usr/lib32 instead of /usr/lib

About Zied

No description. Please complete your profile.
Comments (5) Trackbacks (0)
  1. Hello from Russia!
    Can I quote a post in your blog with the link to you?

  2. This is didn’t work for me. I still see the error. Stack looks like this:

    [ERROR] ** Unable to load Mozilla for hosted mode **
    [ERROR] java.lang.UnsatisfiedLinkError: /home/ddurham/.m2/repository/com/google/gwt/gwt-dev/1.7.0/mozilla-1.7.12/libxpcom.so: libstdc++.so.5: cannot open shared object file: No such file or directory
    [ERROR] at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    [ERROR] at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1778)
    [ERROR] at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1674)
    [ERROR] at java.lang.Runtime.load0(Runtime.java:770)
    [ERROR] at java.lang.System.load(System.java:1003)
    [ERROR] at com.google.gwt.dev.shell.moz.MozillaInstall.load(MozillaInstall.java:190)
    [ERROR] at com.google.gwt.dev.BootStrapPlatform.initHostedMode(BootStrapPlatform.java:53)
    [ERROR] at com.google.gwt.dev.HostedModeBase.(HostedModeBase.java:362)
    [ERROR] at com.google.gwt.dev.SwtHostedModeBase.(SwtHostedModeBase.java:98)
    [ERROR] at com.google.gwt.dev.HostedMode.(HostedMode.java:271)
    [ERROR] at com.google.gwt.dev.HostedMode.main(HostedMode.java:230)

  3. I’m running 64bit linux so needed the link in ‘/usr/lib32/’

    ln -s /usr/lib32/libstdc++.so.5.0.7 /usr/lib32/libstdc++.so.5

  4. I didn’t test it on a 64bit linux.
    I will update the post with your comment since it worked for you.


Leave a comment


No trackbacks yet.