Solved

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

Posted on 2010-08-18
10
1,412 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
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…
Suggested Courses

628 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