Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Mac OS X 64bit Eclipse (3.6.2) "Cannot load 32-bit SWT libraries on 64-bit JVM"(Eclipse shows errors attempting to set VM to 32-bit or 64-bit.)
Mac OS X 64bit Eclipse (3.6.2) "Cannot load 32-bit SWT libraries on 64-bit JVM" [message #743478] Fri, 21 October 2011 14:16 Go to next message
John Evans is currently offline John EvansFriend
Messages: 2
Registered: October 2011
Location: Atlanta, GA
Junior Member
Having been developing a set of plugins for several years on Windows XP, I wanted to move to a mac and develop for that platform also. It has been working ok for a couple months with one nagging problem. Researching I discovered a patch for the SWT problem which required me to set up EGit and get the SWT code. Following the instructions (eclipse.org/swt/git.php), I attempted to test the setup by running one of the tests which failed. Error message:
Cannot load 32-bit SWT libraries on 64-bit JVM
when it runs the code test:
static final boolean IS_64 = longConst() == (int /*long*/)longConst();
which returns false because it casts to -1.

The commiter of the patch suggested I was running a 32bit version of Eclipse that was trying to run in 64-bit mode. so I should use the VM argument -d32 to force the VM into 32-bit mode. Confident that I'd downloaded the 64-bit version of Eclipse, but I downloaded it again (internal IBM source), but got the same error. I downloaded it from eclipse.org and got the same error.
Distinguishing files suggest that I do have 64-bit:
org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.2.R36x_v20101019_1345.jar
org.eclipse.swt.cocoa.macosx.x86_64_3.6.2.v3659b.jar

So I tried his suggestion of adding the VM argument -d32, but doing that I get this error:

java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
/Users/JohnEvans/git/eclipse.platform.swt.binaries/bundles/org.eclipse.swt.cocoa.macosx.x86_64/libswt-cocoa-3807.jnilib: no suitable image found. Did find: /Users/JohnEvans/git/eclipse.platform.swt.binaries/bundles/org.eclipse.swt.cocoa.macosx.x86_64/libswt-cocoa-3807.jnilib: mach-o, but wrong architecture
no swt-cocoa in java.library.path
Can't load library: /Users/JohnEvans/.swt/lib/macosx/x86/libswt-cocoa-3807.jnilib
Can't load library: /Users/JohnEvans/.swt/lib/macosx/x86/libswt-cocoa.jnilib
/Users/JohnEvans/.swt/lib/macosx/x86/libswt-cocoa-3807.jnilib: no suitable image found. Did find: /Users/JohnEvans/.swt/lib/macosx/x86/libswt-cocoa-3807.jnilib: mach-o, but wrong architecture
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:285)

This error suggests that it is 64-bit eclipse.

My conclusion is that I've really downloaded Eclipse 64-bit, but it won't run this test with the VM in either 32-bit or 64-bit mode because it always cast 0x1FFFFFFFFL as an int to -1.

Any ideas what is happening that causes the test to fail?
Re: Mac OS X 64bit Eclipse (3.6.2) "Cannot load 32-bit SWT libraries on 64-bit JVM&quo [message #748179 is a reply to message #743478] Mon, 24 October 2011 14:38 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Hi John,

SWT's source is stored in git in 32-bit form. This can be seen in the
cast of the 64-bit test: (int /*long*/). If the source was in 64-bit
form then it would look like (long /*int*/). This is why the IS_64 test
is evaluating to false even though you are running with 64-bit eclipse.
So you have two choices:

1. Run 32-bit swt. To do this:
- add the -d32 vm argument
- ensure that in your .classpath file that
CLASSPATH_ATTR_LIBRARY_PATH_ENTRY is pointing at
org.eclipse.swt.cocoa.macosx.x86, NOT at org.eclipse.swt.cocoa.macosx.x86_64

2. Run 64-bit swt. To do this:
- convert swt's source to 64-bit form by running the replace.32.to.64
ant target in file org.eclipse.swt/tasks/build.xml, and when it's done
be sure to Refresh (F5) your org.eclipse.swt project
- ensure that in your .classpath file that
CLASSPATH_ATTR_LIBRARY_PATH_ENTRY is pointing at
org.eclipse.swt.cocoa.macosx.x86_64
- you probably do not need to add vm argument -d64, but it can't hurt

HTH,
Grant


On 10/21/2011 10:16 AM, John Evans wrote:
> Having been developing a set of plugins for several years on Windows XP,
> I wanted to move to a mac and develop for that platform also. It has
> been working ok for a couple months with one nagging problem.
> Researching I discovered a patch for the SWT problem which required me
> to set up EGit and get the SWT code. Following the instructions
> (eclipse.org/swt/git.php), I attempted to test the setup by running one
> of the tests which failed. Error message: Cannot load 32-bit SWT
> libraries on 64-bit JVM
> when it runs the code test: static final boolean IS_64 = longConst() ==
> (int /*long*/)longConst(); which returns false because it casts to -1.
>
> The commiter of the patch suggested I was running a 32bit version of
> Eclipse that was trying to run in 64-bit mode. so I should use the VM
> argument -d32 to force the VM into 32-bit mode. Confident that I'd
> downloaded the 64-bit version of Eclipse, but I downloaded it again
> (internal IBM source), but got the same error. I downloaded it from
> eclipse.org and got the same error. Distinguishing files suggest that I
> do have 64-bit:
> org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.2.R36x_v20101019_1345.jar
>
> org.eclipse.swt.cocoa.macosx.x86_64_3.6.2.v3659b.jar
>
> So I tried his suggestion of adding the VM argument -d32, but doing that
> I get this error:
>
> java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
> /Users/JohnEvans/git/eclipse.platform.swt.binaries/bundles/org.eclipse.swt.cocoa.macosx.x86_64/libswt-cocoa-3807.jnilib:
> no suitable image found. Did find:
> /Users/JohnEvans/git/eclipse.platform.swt.binaries/bundles/org.eclipse.swt.cocoa.macosx.x86_64/libswt-cocoa-3807.jnilib:
> mach-o, but wrong architecture
> no swt-cocoa in java.library.path
> Can't load library:
> /Users/JohnEvans/.swt/lib/macosx/x86/libswt-cocoa-3807.jnilib
> Can't load library:
> /Users/JohnEvans/.swt/lib/macosx/x86/libswt-cocoa.jnilib
> /Users/JohnEvans/.swt/lib/macosx/x86/libswt-cocoa-3807.jnilib: no
> suitable image found. Did find:
> /Users/JohnEvans/.swt/lib/macosx/x86/libswt-cocoa-3807.jnilib: mach-o,
> but wrong architecture
> at org.eclipse.swt.internal.Library.loadLibrary(Library.java:285)
>
> This error suggests that it is 64-bit eclipse.
>
> My conclusion is that I've really downloaded Eclipse 64-bit, but it
> won't run this test with the VM in either 32-bit or 64-bit mode because
> it always cast 0x1FFFFFFFFL as an int to -1.
>
> Any ideas what is happening that causes the test to fail?
>
Previous Topic:Search word under cursor
Next Topic:Why application run fail when share same workspace for two eclipse product?
Goto Forum:
  


Current Time: Thu Mar 28 19:40:30 GMT 2024

Powered by FUDForum. Page generated in 0.01792 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top