Eclipse - Standard Widget Toolkit (SWT) - Installation

SWT, the Standard Widget Toolkit, will help us to draw windows for the Java platform.

On this webpage you will find links to download last stable releases

Once downloaded, open Eclipse, right click on the Explorer tab, then : Import... > General > Existing Projects into Workspace.
Click Next then select the Select archive file option and browse until, for example for Windows OS, your file.

Click Finish.

Now in your Package Explorer you can see the org.eclipse.swt project.

Right click in this Explorer to create a new Java project named for example project1.

Right click on project1 > Build Path > Configure Build Path > Java Build Path.
On the right there are several tabs.
Select Projects and click Add...
Select org.eclipse.swt and click OK.

You project project1 is now linked with SWT and you can use its classes.




Thank You Mi-K !!!

HelloWorldSWT  which is the 1st example of SWT given after the installation of Eclipse does not work on Windows (I just tested it on Seven).

Yypically you get those errors:

Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
    no swt-win32-3738 in java.library.path
    no swt-win32 in java.library.path
    Can't load library: C:\Users\<YourUserName>\.swt\lib\win32\x86\swt-win32-3738.dll
    Can't load library: C:\Users\<YourUserName>\.swt\lib\win32\x86\swt-win32.dll

    at org.eclipse.swt.internal.Library.loadLibrary(
    at org.eclipse.swt.internal.Library.loadLibrary(
    at org.eclipse.swt.internal.C.<clinit>(
    at org.eclipse.swt.widgets.Display.<clinit>(
    at HelloWorldSWT.main(

After  the download  of and by following the above given explanations by Mi-K, it just works.

By the way  you can find for example here:



Yes, this fix worked for me as well. Thanks for that!


They should add this step to the tutorial  :-D


Yes this does work - in my eclipse you have to right click on your project and select "Properties" and then navigate to the build path screen.

Thank you!


Thank you so much, these steps fix my problem.


Hi, it does not works now.

Eclipse says "Some projects cannot be imported because they already exist in the workspace". Please, help!


Hello Kostyanus,

Just rename your project with another name or delete it from your computer.



I am trying too import missing
Can't load library: C:\Users\Admin\.swt\lib\win32\x86_64\swt-win32-4427.dll
Can't load library: C:\Users\Admin\.swt\lib\win32\x86_64\swt-win32.dll
but still facing with error. Any idas?


Done. Import is finished.
But now error has chenged.

Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Display cannot be resolved to a type
Display cannot be resolved to a type
Shell cannot be resolved to a type
Shell cannot be resolved to a type

Java text is:

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

public class HelloWorldSwt {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);

shell.setText("Hello, world!");;
// Set up the event loop.
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
// If no more entries in the event queue

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.