Accepted answer

on my ubuntu 12.04 32 bit. i edit the command to:

ln -s /usr/lib/jni/libswt-* ~/.swt/lib/linux/x86/

and on ubuntu 12.04 64 bit try:

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


please make sure that your home partition is mounted with executable permissions. that is the default, but if you happen to mount it without exec option, you will get this error.


a possibly more generic method is to:

  • install non-headless version of the openjdk,
  • install, run and close eclipse.
  • uninstall the openjdk
  • install oracle's jdk


i installed the jdk 32 bit because of that i am getting the errors. after installing jdk 64 bit jdk-8u131-linux-x64.tar.gz(please download the 64 version) and download 64 bit "eclipse-inst-linux64.tar.gz".


i came across this error when tried to start 32-bit build of eclipse under 64-bit linux. the problem was solved after installing ia32-libs package.


if you start eclipse using oracle java, then eclipse might fail in finding native libraries like swt or svn libraries. the swt-jni libraries are located in /usr/lib/jni/ and the svn-jni libraries are located in /usr/lib/x86_64-linux-gnu/jni/.

instead of starting eclipse with the command


you can use the command

env ld_library_path=/usr/lib/jni/:/usr/lib/x86_64-linux-gnu/jni/:$ld_library_path eclipse

to pass the environment variable ld_library_path to eclipse. eclipse will find the native libraries and will run properly.


i'm on debian linux amd64. i installed oracle's java 11 from oracle's java download page. installed eclipse from running eclipse produced the "cannot load swt" error. i followed atorras's advice and did apt install libswt-gtk-4-jni (which also installed a ton of other things) and after that eclipse started. although it started i did get the following errors/warnings:

org.eclipse.m2e.logback.configuration: the org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized.  will retry after the state location is initialized.
swt sessionmanagerdbus: failed to connect to org.gnome.sessionmanager: failed to execute child process “dbus-launch” (no such file or directory)
swt sessionmanagerdbus: failed to connect to org.xfce.sessionmanager: failed to execute child process “dbus-launch” (no such file or directory)
org.eclipse.m2e.logback.configuration: logback config file: /home/rusty/eclipse-workspace/.metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.
org.eclipse.m2e.logback.configuration: initializing logback
swt webkit: warning, you are using an old version of webkitgtk. (pre 2.4) browserfunction functionality will not be avaliable
swt webkit: error initializing dbus server, dbusserver == 0
swt.chromium style was used but chromium.swt gtk (or cef binaries) fragment/jar is missing.

i think i can ignore most if not all of that. i'm doing an ssh into the linux box using mobaxterm on my windows pc, so it's displaying its window on my pc. my linux box is headless.


i agree with scott, what he listed worked. however just running it from any directory did not work. i had to cd to the /home/*/.swt/lib/linux/x86_64/ 0 files

directory first and then run the link command:

for 32 bit:

ln -s /usr/lib/jni/libswt-* ~/.swt/lib/linux/x86/

and on ubuntu 12.04 64 bit:

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


on redhat7 :

yum install gtk2 libxtst xorg-x11-fonts-type1

did the job, because of a swt dependency.

found here


can't load library: /home/tom/.swt/lib/linux/x86_64/
can't load library: /home/tom/.swt/lib/linux/x86_64/

looks like the libraries should be at .swt/lib/linux/x86_64/ if there are not there you can try this command:


this should find the libraries copy the entire directory to /home/tom/.swt/lib/linux/x86_64


for windows subsystem for linux (wsl) you'll need

apt install libswt-gtk-4-jni

if you don't have an openjdk 8 you'll also need

apt install openjdk-8-jdk


in my case, i was missing the /usr/lib/jni directory entirely. fixed by

sudo apt-get install libswt-gtk-3-jni libswt-gtk-3-java

no need to symlink afterwards. eclipse started normally.


simply specify the path to the libraries:

echo "-djava.library.path=/usr/lib/jni/" >> /etc/eclipse.ini



because i had installed the oracle java 7 it had changed the default java to oracle java 7, however it needed to be the open jdk.

to fix, open up terminal and type

sudo update-alternatives --config java

this brings up a list of the different types of java. simply select the open jdk.

Related Query

More Query from same tag