Eclipse cannot find swt-gtk

Bug #989615 reported by jussi haverinen
108
This bug affects 26 people
Affects Status Importance Assigned to Milestone
eclipse (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

After 12.04 update eclipse cannot find libswt anymore and refuses to start. The log is attached to below. No other changes to system besides update from 11.10 to 12.04.

eclipse:
  Installed: (none)
  Candidate: 3.7.2-1
  Version table:
     3.7.2-1 0

!SESSION 2012-04-27 13:50:53.819 -----------------------------------------------
eclipse.buildId=I20110613-1736
java.version=1.6.0_31
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments: -os linux -ws gtk -arch x86_64

!ENTRY org.eclipse.osgi 4 0 2012-04-27 13:50:56.355
!MESSAGE Application error
!STACK 1
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/koo/.swt/lib/linux/x86_64/libswt-gtk-3740.so
        Can't load library: /home/koo/.swt/lib/linux/x86_64/libswt-gtk.so

        at org.eclipse.swt.internal.Library.loadLibrary(Library.java:285)
        at org.eclipse.swt.internal.Library.loadLibrary(Library.java:194)
        at org.eclipse.swt.internal.C.<clinit>(C.java:21)
        at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:63)
        at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:54)
        at org.eclipse.swt.widgets.Display.<clinit>(Display.java:132)
        at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:695)
        at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:161)
        at org.eclipse.ui.internal.ide.application.IDEApplication.createDisplay(IDEApplication.java:153)
        at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:95)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1386)

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in eclipse (Ubuntu):
status: New → Confirmed
Revision history for this message
Peter Wolf (onti) wrote :

Here is a small workaround:
ln -s /usr/lib/jni/libswt-gnome-gtk-3740.so ~/.swt/lib/linux/x86_64/libswt-gtk.so

Revision history for this message
Peter Wolf (onti) wrote :

Oh, this bug happens with Oracle Java 7... So switching to OpenJDK helps too.

Revision history for this message
Ryan owens (ryanvader) wrote :

also affects Black Opal

Revision history for this message
Michael (michael-muster) wrote :

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

Revision history for this message
y s (yusuhail) wrote :

After doing
ln -s /usr/lib/jni/libswt-gnome-gtk-3740.so ~/.swt/lib/linux/x86_64/libswt-gtk.so

It still halts on startup. Here is the log file

!SESSION 2012-12-27 11:14:12.565 -----------------------------------------------
eclipse.buildId=I20110613-1736
java.version=1.7.0_10
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments: -os linux -ws gtk -arch x86_64

!ENTRY org.eclipse.osgi 4 0 2012-12-27 11:14:14.262
!MESSAGE Application error
!STACK 1
java.lang.UnsatisfiedLinkError: org.eclipse.swt.internal.C.PTR_sizeof()I
        at org.eclipse.swt.internal.C.PTR_sizeof(Native Method)
        at org.eclipse.swt.internal.C.<clinit>(C.java:24)
        at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:63)
        at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:54)
        at org.eclipse.swt.widgets.Display.<clinit>(Display.java:132)
        at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:695)
        at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:161)
        at org.eclipse.ui.internal.ide.application.IDEApplication.createDisplay(IDEApplication.java:153)
        at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:95)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
 at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1386)

Revision history for this message
Beanow (beanow) wrote :

Same for me when just installing rather than upgrading. However I have both OpenJDK and Oracle's Java installed (got to have Minecraft after all).

!SESSION 2013-02-01 13:16:47.514 -----------------------------------------------
eclipse.buildId=I20110613-1736
java.version=1.7.0_02
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments: -os linux -ws gtk -arch x86_64

!ENTRY org.eclipse.osgi 4 0 2013-02-01 13:16:48.511
!MESSAGE Application error
!STACK 1
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/beanow/.swt/lib/linux/x86_64/libswt-gtk-3740.so
 Can't load library: /home/beanow/.swt/lib/linux/x86_64/libswt-gtk.so

 at org.eclipse.swt.internal.Library.loadLibrary(Library.java:285)
 at org.eclipse.swt.internal.Library.loadLibrary(Library.java:194)
 at org.eclipse.swt.internal.C.<clinit>(C.java:21)
 at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:63)
 at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:54)
 at org.eclipse.swt.widgets.Display.<clinit>(Display.java:132)
 at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:695)
 at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:161)
 at org.eclipse.ui.internal.ide.application.IDEApplication.createDisplay(IDEApplication.java:153)
 at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:95)
 at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
 at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
 at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
 at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
 at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
 at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
 at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
 at org.eclipse.equinox.launcher.Main.main(Main.java:1386)

Revision history for this message
Beanow (beanow) wrote :

#5's solution also worked for me.

Revision history for this message
V字龍(Vdragon) (vdragon) wrote :

#5 workaround +1 too, thanks
Ubuntu 12.04LTS
Java uses default alternative.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.