Solved

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

Posted on 2010-08-18
10
1,382 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
Comment Utility
Do a search on *.dll under the install dir
0
 
LVL 1

Author Comment

by:slightlyoff
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 1

Author Comment

by:slightlyoff
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
:-)
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

772 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

10 Experts available now in Live!

Get 1:1 Help Now