Jump to content
Read the Funtoo Newsletter: Summer 2023 ×
  • 0

java.lang.UnsatisfiedLinkError: Could not load SWT library with Eclipse SDK



Dear All,


i just installed my Funtoo, so it could be that i have not set everything correctly.


I am trying to bring eclipse-sdk-bin-4.3.1 to run, unfortunately i have swt problem with java.


After trying to run eclipse (after installation) i got following error:

!SESSION 2016-05-25 00:42:02.225 -----------------------------------------------
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.java.product 
Command-line arguments:  -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.java.product 
!ENTRY org.eclipse.osgi 4 0 2016-05-25 00:42:04.543
!MESSAGE Application error
java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
        /home/edx/.eclipse/99815505_linux_gtk_x86_64/configuration/org.eclipse.osgi/bundles/318/1/.cp/libswt-gtk-4333.so: /home/edx/.eclipse/99815505_linux_gtk_x86_64/configuration/org.eclipse.osgi/bundles/318/1/.cp/libswt-gtk-4333.so: failed to map segment from shared object
        no swt-gtk in java.library.path
        Can't load library: /home/edx/.swt/lib/linux/x86_64/libswt-gtk-4333.so
        Can't load library: /home/edx/.swt/lib/linux/x86_64/libswt-gtk.so
        /home/edx/.swt/lib/linux/x86_64/libswt-gtk-4333.so: /home/edx/.swt/lib/linux/x86_64/libswt-gtk-4333.so: failed to map segment from shared object
        at org.eclipse.swt.internal.Library.loadLibrary(Library.java:331)
        at org.eclipse.swt.internal.Library.loadLibrary(Library.java:240)
        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:133)
        at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:675)
        at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:162)
        at org.eclipse.ui.internal.ide.application.IDEApplication.createDisplay(IDEApplication.java:154)
        at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:96)
        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:354)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1426)

After googling this problem, it seems that I am not the only one with this problem, but the solution that was suggested  

ln -s /usr/lib64/libswt-* ~/.swt/lib/linux/x86_64/

did not solve my problem.


No i get following error:

!SESSION 2016-05-24 20:35:54.521 -----------------------------------------------
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=de_DE
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.java.product
!ENTRY org.eclipse.osgi 4 0 2016-05-24 20:35:55.266
!MESSAGE Application error
java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
        /home/edx/.eclipse/99815505_linux_gtk_x86_64/configuration/org.eclipse.osgi/bundles/318/1/.cp/libswt-gtk-4333.so: /home/edx/.eclipse/99815505_linux_gtk_x86_64/configuration/org.eclipse.osgi/bundles/318/1/.cp/libswt-gtk-4333.so: Fehler beim Mappen des Shared Objects
        no swt-gtk in java.library.path
        /home/edx/.swt/lib/linux/x86_64/libswt-gtk-4333.so: /home/edx/.swt/lib/linux/x86_64/libswt-gtk-4333.so: Fehler beim Mappen des Shared Objects
        Can't load library: /home/edx/.swt/lib/linux/x86_64/libswt-gtk.so

This is my emerge --info output:

Portage 2.2.26 (python 2.7.11-final-0, funtoo/1.0/linux-gnu/arch/pure64, gcc-4.9.3, glibc-2.21, 4.5.4-gentoo x86_64)
System uname: Linux-4.5.4-gentoo-x86_64-Intel-R-_Core-TM-_i7-4770K_CPU_@_3.50GHz-with-gentoo-2.2.0
KiB Mem:    16377980 total,  11783980 free
KiB Swap:   16777212 total,  16777212 free
sh bash 4.3_p42
ld GNU ld (Funtoo 2.25) 2.25.0
app-shells/bash:          4.3_p42::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.22.2::gentoo
dev-lang/python:          2.7.11-r2::gentoo, 3.4.3-r7::gentoo
dev-util/cmake:           3.5.2-r1::gentoo
sys-apps/baselayout:      2.2.0-r6::gentoo
sys-apps/openrc:          0.18.3-r2::gentoo
sys-apps/sandbox:         2.10-r2::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r2::gentoo
sys-devel/automake:       1.11.6-r2::gentoo, 1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.25-r2::gentoo
sys-devel/gcc:            4.9.3-r3::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r2::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.3::gentoo (virtual/os-headers)
sys-libs/glibc:           2.21::gentoo

    location: /usr/portage
    sync-type: git
    sync-uri: git://github.com/funtoo/ports-2012.git
    priority: -1000

    location: /var/overlay/local
    masters: gentoo

    location: /var/lib/layman/java
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/proj/java.git
    masters: gentoo
    priority: 50

    location: /var/lib/layman/kde
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/proj/kde.git
    masters: gentoo
    priority: 50

Installed sets: @kde-plasma
ACCEPT_KEYWORDS="amd64 ~amd64"
CFLAGS="-march=core-avx2 -O2 -pipe"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=core-avx2 -O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-mtune=generic -O2 -pipe"
GENTOO_MIRRORS="http://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/ http://mirror.eu.oneandone.net/linux/distributions/gentoo/gentoo/ http://mirror.leaseweb.com/gentoo/"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed"
USE="X a52 aac acl alsa amd64 apng berkdb bluray bzip2 cdda cddb cdio cdr consolekit cracklib crypt cups cxx dbus declarative dri dts dvd dvdr dvdread encode exif faac faad ffmpeg flac gdbm gif gpm hpcups ico iconv icu ieee1394 ios ipod ipv6 jpeg jpeg2k kde kipi lame libass libguess libmpeg2 mad matplotlib matroska mjpeg mmx modules mp3 mpeg mtp mudflap ncurses nls nptl nsplugin ogg opengl openmp pam pcre pdf phonon plasma png policykit postproc pppd python qml qt5 quicktime readline resolvconf semantic-desktop sndfile sse sse2 ssl svg taglib tcpd theora tiff truetype twolame udev unicode v4l vorbis vpx wav wavpack webp widgets win32codecs wmf x264 x265 xattr xcomposite xinerama xml xscreensaver xvid zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel ice1724 intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias authn_core authz_core socache_shmcb unixd" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2 canon" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64 pc" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php5-5" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby20 ruby21 ruby22" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"

Any ideas?

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0

I don't really know what it did that made it work, but it works.


The last steps i did were:

  1. starting eclipse from root (worked after small modification of the file  /usr/bin/eclipse-bin-4.3)

          adding -XX:-UseBiasedLocking to the last line

          which now looks like:

exec "${ECLIPSE_BIN}" -vm $(java-config --java) "$@" "${ECLIPSE_USER_ARGS}" -vmargs ${VM_ARGS} -XX:-UseBiasedLocking 

      2. remove ~/.eclipse directory

      3. java-config --set-user-vm=oracle-jdk-bin-1.8

      4. java-config-2 --set-user-vm=oracle-jdk-bin-1.8

      5. start eclipse




Link to comment
Share on other sites

  • 0

the outputs of scanelf -nf $(qlist eclipse-sdk-bin | sort) and qlist eclipse-sdk-bin | sort were very long.

That is why I uploaded them as files



Output of: scanelf -nf $(qlist eclipse-sdk-bin | sort)

ET_EXEC libpthread.so.0,libdl.so.2,libc.so.6 /opt/eclipse-sdk-bin-4.3/eclipse 
ET_DYN libpthread.so.0,libdl.so.2,libc.so.6 /opt/eclipse-sdk-bin-4.3/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20130807-1835/eclipse_1506.so 



Link to comment
Share on other sites

  • 0

I just tried to start NetBeans IDE 8.1 and i got following message:

The JDK is missing and is required to run some NetBeans modules
Please use the --jdkhome command line option to specify a JDK     


How could i test in Funtoo if my Java path are correctly set?


Since it seems that all is connected together

Link to comment
Share on other sites

  • 0

I was able to make netbeans to work. There was a difference between my root java config and user. After choosing the correct JDK

it sarted to work.

java-config --list-available-vms

The following VMs are available for generation-2:
*)      Oracle JDK [oracle-jdk-bin-1.8]
2)      Oracle JRE [oracle-jre-bin-1.8]
Link to comment
Share on other sites

  • 0

unfortunately not.


I think my problem is somewhere in my java.library.path.

java-config-2 -l

[ant-core] Java-based build tool similar to 'make' that uses XML configuration files (/usr/share/ant-core/package.env)
[swt-4.2] GTK based SWT Library (/usr/share/swt-4.2/package.env)
[eclipse-ecj-4.5] Eclipse Compiler for Java (/usr/share/eclipse-ecj-4.5/package.env)
[vuze] BitTorrent client in Java, formerly called Azureus (/usr/share/vuze/package.env)
[javacc] Java Compiler Compiler - The Java Parser Generator (/usr/share/javacc/package.env)
[junit] Simple framework to write repeatable tests (/usr/share/junit/package.env)
[ant-eclipse-ecj-4.5] Ant Compiler Adapter for Eclipse Java Compiler (/usr/share/ant-eclipse-ecj-4.5/package.env)
[commons-lang-2.1] Commons components to manipulate core java classes (/usr/share/commons-lang-2.1/package.env)
[json-simple] Simple Java toolkit for JSON (/usr/share/json-simple/package.env)
[swt-3.8] GTK based SWT Library (/usr/share/swt-3.8/package.env)
[commons-cli-1] A Java library for working with the command line arguments and options (/usr/share/commons-cli-1/package.env)
[log4j] A low-overhead robust logging package for Java (/usr/share/log4j/package.env)

but if i try to set my default java CLASSPATH i get following error:

java-config-2 --set-system-classpath=log4j,swt-4.2,eclipse-ecj-4.5
!!! WARNING: Setting a user and system classpath is deprecated, this option will be removed from future versions.
!!! ERROR: Package log4j was not found!
!!! ERROR: Package swt-4.2 was not found!
!!! ERROR: Package eclipse-ecj-4.5 was not found!
>>> Regenerating /etc/ld.so.cache...
!!! ALERT: If you want the changes too take effect in your current session, you should update
                       your environment by running: source /etc/profile

althought the packages log4j, swt-4.2 and eclipse-ecj-4.5 are installed.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...