Eclipse Cannot Load Swt Libraries

Eclipse cannot load SWT libraries

on my Ubuntu 12.04 32 bit. I edit the command to:

ln -s /usr/lib/jni/libswt-* ~/.swt/lib/linux/x86/

And on Ubuntu 12.04 64 bit try:

ln -s /usr/lib/jni/libswt-* ~/.swt/lib/linux/x86_64/

Eclipse 4-10 64bit: Cannot resolve SWT library

In case you have a module-info.java file in the default package, delete it.

Having a module-info.java file enables the optional use of the Java Platform Module System (JPMS) which requires to specify all required modules.

Instead of deleting module-info.java you can also:

  1. In the Java Build Path move the org.eclipse.swt project from the Classpath to the Modulepath
  2. In module-info.java add the line requires org.eclipse.swt;

Could not load SWT library on Windows 32-bit

Correct DLL files are inside swt.jar for your particular platform. You need to download SWT for Windows (not x86_64), e.g. "swt-4.2.1-win32-win32-x86.zip" from http://download.eclipse.org/eclipse/downloads/drops4/R-4.2.1-201209141800/#SWT.

It looks as if you have tried to use swt.jar from linux SWT. That won't work. You need to download platform-specific SWT package For each platform that you want to support.

Cannot load 64-bit SWT libraries on 32-bit JVM (even though I downloaded 32-bit SWT)

SWT uses plugin fragments to control this - there is a 32-bit fragment and a 64-bit fragment (as well as fragments for Mac, Linux, etc). Make sure your launch configuration is set to use the proper fragment depending on which JVM you're running it on.

As a note, just including "both" plugin fragments will not work, as then they will both attempt to load and cause problems.

Also, this related question may be useful.

Another idea would be to dive into the loadLibrary function - from what I remember of how that works, it looks for a cached version of the SWT dll from a temp location somewhere, and so it might be using a cached 64-bit dll instead of properly unpacking the 32-bit one from the jar. In that case, deleting the cached one may fix the issue.

The easiest solution, though, may be just to have two separate instances of Eclipse: one setup to run 32-bit, one setup to run 64-bit. This way you don't have to worry about toggling back and forth, or futz around with configurations as much.



Related Topics



Leave a reply



Submit