Solved

Eclipse SWT - Jave error: no swt-win32-2133 in java.library.path

Posted on 2010-08-18
10
1,396 Views
Last Modified: 2013-12-14
I'm trying to follow eclipse's tutorial on using SWT.  I've installed everything and I get to the point of running it and I get the following error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-win32-2133 in java.library.path
      at java.lang.ClassLoader.loadLibrary(Unknown Source)
      at java.lang.Runtime.loadLibrary0(Unknown Source)
      at java.lang.System.loadLibrary(Unknown Source)
      at org.eclipse.swt.internal.Library.loadLibrary(Library.java:108)
      at org.eclipse.swt.internal.win32.OS.<clinit>(OS.java:46)
      at org.eclipse.swt.widgets.Display.internal_new_GC(Display.java:1291)
      at org.eclipse.swt.graphics.Device.init(Device.java:547)
      at org.eclipse.swt.widgets.Display.init(Display.java:1310)
      at org.eclipse.swt.graphics.Device.<init>(Device.java:96)
      at org.eclipse.swt.widgets.Display.<init>(Display.java:291)
      at org.eclipse.swt.widgets.Display.<init>(Display.java:287)
      at helloWorld.HelloWorldSWT.main(HelloWorldSWT.java:14)

I've googled this and found several things and I've tried them with no luck.  For example, one of the posts says:

"Try
adding this to your VM Arguments:

-Djava.library.path=C:\Program
Files\eclipse\plugins\org.eclipse.swt.win32\os\win32\x86"

I've installed eclipse on my root directory - so in my case this should be:
-Djava.library.path=C:\eclipse\plugins

But after that I have no "org.eclipse.swt.win32" folder

I'm using Windows 7, 64 bit, so I'm thinking even if I had this folder, it woudln't be right.

As a new user to Eclipse and Java both, this is a little confusing.
Any ideas on what I need to do?

Thanks!
0
Comment
Question by:slightlyoff
  • 5
  • 4
10 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 33467289
Do a search on *.dll under the install dir
0
 
LVL 1

Author Comment

by:slightlyoff
ID: 33467913
it found 2 .dll files:

swt-gdip-win32-3650.dll
and
swt-win32-3650.dll

in C:\eclipse\configuration\org.eclipse.osgi\bundles\212\1\.cp

Should this be used in the  VM Arguments?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 33468411
Yes, you can try the following, but of course you need to beware of the 23/64bit issue
-Djava.library.path=C:\eclipse\configuration\org.eclipse.osgi\bundles\212\1\.cp

Open in new window

0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 1

Author Comment

by:slightlyoff
ID: 33469680
Still get the same issue.

java.lang.UnsatisfiedLinkError: no swt-win32-2133 in java.library.path.

I copied the -Djava.library.path=C:\eclipse\configuration\org.eclipse.osgi\bundles\212\1\.cp
 into the VM arguments.

This is so weird... because I can't find anything about it elsewhere.

Thanks for your help!

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 33470322
Could you place the following as the first line of main and tell me what it prints?
System.out.println(System.getProperty("java.library.path"));

Open in new window

0
 
LVL 1

Author Comment

by:slightlyoff
ID: 33476798
Sorry couldn't respond yesterday...  here's what it says:

C:\eclipse\configuration\org.eclipse.osgi\bundles\212\1\.cp

I've also attached my code just to show what I have.

I notice that the error specifies: "no swt-win32-2133" in java.library.path

And the .dlls I found are:
swt-gdip-win32-3650.dll
swt-win32-3650.dll

Should I find a swt-win32-2133 dll?  and if not - is there a place i can change it so it looks for one of the others instead?
package helloWorld;

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

public class HellowWorld {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		System.out.println(System.getProperty("java.library.path"));

		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();
	}

}

Open in new window

0
 
LVL 86

Accepted Solution

by:
CEHJ earned 250 total points
ID: 33477220
Yes it looks like you have a slightly broken implementation - it's looking for the wrong dependency. Try getting a different version.

You could try copying the dll to the expected name, but i wouldn't set your hopes too high ...
0
 
LVL 92

Assisted Solution

by:objects
objects earned 250 total points
ID: 33481006
youre version of SWT is not compatible with your version of eclipse.
Suggest you grab the latest version of eclipse and try it

> I copied the -Djava.library.path=C:\eclipse\configuration\org.eclipse.osgi\bundles\212\1\.cp
 into the VM arguments.

thats wrong

> Should I find a swt-win32-2133 dll?  and if not - is there a place i can change it so it looks for one of the others instead?

no it shouldn't, thats old
upgrading your eclipse should resolve it
0
 
LVL 1

Author Closing Comment

by:slightlyoff
ID: 33637599
Thanks for your help with this.  I'm using SWING for now, I'll have to implement your suggestions at a later time.  This was frustrating, but I appreciate your help!
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 33640044
:-)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This video teaches viewers about errors in exception handling.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question