CodeCamper
CodeCamper

Reputation: 6984

Shouldn't the library path default to the workspace path?

I am doing the HelloWorldSWT tutorial in Version: Kepler Release Build id: 20130606-0932 and when I run my application I get

Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: no swt-win32-4332 in java.library.path no swt-win32 in java.library.path Can't load library: C:\Users\CodeCamper.swt\lib\win32\x86_64\swt-win32-4332.dll Can't load library: C:\Users\CodeCamper.swt\lib\win32\x86_64\swt-win32.dll

Why doesn't the library path default to my workspace folder where Eclipse is dropping the libraries in automatically.

C:\eclipse\workspace

All the necessary files are being imported into this folder when I import libraries to my project. Doing a simple google search the only viable answer I saw was to copy the folders imported in the workspace folder into that local path. I put eclipse on my C drive because I want my eclipse to be easily portable.

What setting do I need to change to make the IDE look in my workspace folder for the libraries?

*note I know how to copy and paste the dlls to the location it wants but that is my problem it is very cumbersome and creates an issue if I want my eclipse on a flash drive going on multiple computers.

Upvotes: 2

Views: 4210

Answers (1)

Marty
Marty

Reputation: 212

Just experienced the same problem myself.

Here's how to fix the immediate problem:-

  1. Right click on your project in Package Explorer on the left (not the class, the main project 'HelloWorldSWT'), and select Properties.
  2. Select the Java Build Path on the left, and the Projects tab on the right.
  3. Expand org.eclipse.swt.etc
  4. Click on Native Library Location, then the Edit button
  5. In the popup that appears click on the Workspace button
  6. Click on org.eclipse.swt.etc (don't expand just click on it), and click OK.

Credit to the Eclipse forum for the answer - would probably have taken me another 3 days to figure this on my own... :-)

There may well be a better way to 'fix' this more globally.

Upvotes: 8

Related Questions