Fedora Linux Support Community & Resources Center
Old 20th July 2012, 04:24 PM
darktemplaaa Offline
Registered User
Join Date: Jul 2012
Location: Germany
Posts: 3
Could not load SWT library FC17 and Eclipse 4.2.0

Hi at all,

somehow there's no swt library in my home folder in /home/timo/.swt/lib/linux/x86_64/. Anyone else has the same problem? Just do a simple "HelloWorld" Test with SWT import like:

import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class HelloWorldSWT {

* @param args
public static void main(String[] args) {
// TODO Auto-generated method stub

Display display = new Display();
Shell shell = new Shell(display);
shell.setText("Hello world!");
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) display.sleep();



It gives you following output:

Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
no swt-gtk-4233 in java.library.path
no swt-gtk in java.library.path
Can't load library: /home/timo/.swt/lib/linux/x86_64/libswt-gtk-4233.so
Can't load library: /home/timo/.swt/lib/linux/x86_64/libswt-gtk.so

at org.eclipse.swt.internal.Library.loadLibrary(Libra ry.java:331)
at org.eclipse.swt.internal.Library.loadLibrary(Libra ry.java:240)
at org.eclipse.swt.internal.C.<clinit>(C.java:21)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Conve rter.java:63)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Conve rter.java:54)
at org.eclipse.swt.widgets.Display.<clinit>(Display.j ava:133)
at HelloWorldSWT.main(HelloWorldSWT.java:13)

So why are the libraries not in ~/.swt????
Reply With Quote
Old 21st July 2012, 07:57 PM
weitjong Offline
Registered User
Join Date: Oct 2006
Location: Singapore, 新加坡
Posts: 989
Re: Could not load SWT library FC17 and Eclipse 4.2.0

Why do you expect it to be there? In order for me to compile successfully the HelloWorldSWT class in Eclipse 4.2.0, first I have to add the SWT library into the project's java build path. After that the program runs fine on my F17 x86_64 system. In my 64-bit system, the SWT library is found in "/usr/lib64/eclipse/" folder. I believe they are there because of "eclipse-swt" package. Alternatively, use the SWT standalone download as recommended here.

To run the Java class outside of Eclipse IDE, I use this command.
CLASSPATH=/usr/lib64/eclipse/swt.jar:. java HelloWorldSWT
YaoWT - Leave no window unbroken ♪ (^。^) 

Last edited by weitjong; 21st July 2012 at 08:00 PM.
Reply With Quote
Old 27th July 2012, 09:51 PM
darktemplaaa Offline
Registered User
Join Date: Jul 2012
Location: Germany
Posts: 3
Re: Could not load SWT library FC17 and Eclipse 4.2.0

Thank you! Yeah I forgot to add the path in the "Native library location" in the Projects tab under org.eclipse.swt.gtk.linux.x86_64 which is /usr/lib64/eclipse.
Reply With Quote

eclipse, fc17, library, load, swt

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fresh FC17 Install : gnome_control_control-center-3.4.2-1.fc17.i686 CORE DUMP reflex Installation, Upgrades and Live Media 1 2nd June 2012 03:05 AM
F16_64: cannot load shared library mdberger Using Fedora 1 25th November 2011 12:44 AM
PHP Startup: Unable to load dynamic library yu xintian Using Fedora 5 26th May 2010 04:29 PM
Cannot load .so file from java library path whalesurf Using Fedora 0 2nd December 2005 08:23 PM

Current GMT-time: 07:33 (Saturday, 19-08-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat