I have been trying to setup swt in eclipse Juno, but it keeps on giving me errors. Here is the error list:

Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
    no swt-win32-4233 in java.library.path
    no swt-win32 in java.library.path
    Can't load library: C:\Users\DeoFamily\.swt\lib\win32\x86_64\swt-win32-4233.dll
    Can't load library: C:\Users\DeoFamily\.swt\lib\win32\x86_64\swt-win32.dll

    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.widgets.Display.<clinit>(Display.java:138)
    at HelloWorldSWT.main(HelloWorldSWT.java:12)

Here is the code:

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


public class HelloWorldSWT {

    /**
     * @param args
     */
    public static void main(String[] args) {

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

        }

}

I have already imported the SWT folder into my project, but it is still not working. What am I doing wrong?

Important details are missing from your post. Which OS (Win 7 64 or 32 bit)? Which Java version (32 or 64 bit JVM; try doing java -version at the command line)?

If you are using a 32 bit JVM, you need to install 32 bit SWT. Likewise, for convinience, make sure everything is 64 bit (i.e. Java and SWT) in case your OS is 64 bit.

Ohhhh that's the problem, I needed to use the 34-bit SWT. Thanks now it works.

I installed "jdk-7u5-windows-x64" and "eclipse-SDK-4.2-win32-x86_64".
64 bit Win7. Also this problem.
Are they the right choices?

Looks good. What is the exact error you are getting (complete trace)? Also, are you sure you don't have multiple Java versions installed? Which JVM does the Eclipse refer to? What does java -version show?

Edited 4 Years Ago by ~s.o.s~

This question has already been answered. Start a new discussion instead.