Solved

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

Posted on 2010-08-18
10
1,390 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Free Alternative to JIRA 4 91
what is the difference between "sudo su" and "su - root" 6 106
servlet  URL Rewriting 1 27
egit plugin on eclipse 8 40
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

895 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now