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:
- In the Java Build Path move the org.eclipse.swt project from the Classpath to the Modulepath
- In
module-info.java
add the linerequires 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
Java Jar File: Use Resource Errors: Uri Is Not Hierarchical
Why Isn't There a Java.Lang.Array Class? If a Java Array Is an Object, Shouldn't It Extend Object
How to Inject Authenticationmanager Using Java Configuration in a Custom Filter
Does Setting Java Objects to Null Do Anything Anymore
How to Remove Special Characters from a String
How to Go About Formatting 1200 to 1.2K in Java
Method Overloading and Choosing the Most Specific Type
How to Replace the Awt Eventqueue with Own Implementation
Scanner Nosuchelementexception
Why Won't This Generic Java Code Compile
How to Show/Hide a Column at Runtime
Spring Security Configuration - Httpsecurity VS Websecurity
Purpose of Default or Defender Methods in Java 8
Io Error: the Network Adapter Could Not Establish the Connection
How to Get Out of While Loop in Java with Scanner Method "Hasnext" as Condition
Using Mockito with Multiple Calls to the Same Method with the Same Arguments