Solved

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

Posted on 2010-08-18
10
1,394 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
firstswap challenge 20 78
rhino JavaScript import, load 25 84
How do I remove an object from a 3 27
Java: The Public Class Main 4 17
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
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…
The viewer will learn how to implement Singleton Design Pattern in Java.
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…

803 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