Menu

#17 Mac OSX 32/64-bit SWT library issue

closed
None
5
2012-09-17
2009-02-14
Alexander
No

PasswordSafeSWT 0.7-beta3.103
Mac OS 10.5.6 Intel (Core 2 Duo and later) with Java 1.6 (64bit) and 1.5 (32/64bit)

[LaunchRunner Error] org.pwsafe.passwordsafeswt.PasswordSafeJFace.main(String[]) threw an exception:
java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM

This is caused by not bundling 64bit SWT libraries.

Workaround:

a) in Info.plist correct JVMVersion from "1.5+" to "1.5*"

b) instruct users with 64bit CPUs to ensure that "J2SE 5.0 32-bit" is listed before "J2SE 5.0 64-bit" in Mac OS "Java Preferences"

Thank you.

Discussion

  • David

    David - 2009-02-15

    Hi Tristan,

    yet another mac build?

     
  • Tristan Nixon

    Tristan Nixon - 2009-06-09

    The workaround noted here didn't work for me.

    What did work was adding the following key to the Info.plist file:

    <key>LSArchitecturePriority</key>
    <array>
    <string>i386</string>
    </array>

    This key tells OS X what architectures can be used to run the app. In this case it specifies that the app should only be run as an i386 (ie 32-bit) app - and OS X seems to be smart enough to force it to run in the 32-bit JVM.

    I can make a new 0.7 build - but this issue seems to not exist in the most recent 0.8-beta1 build - so maybe its not necessary.

    If anyone would like a new 0.7 build with this key in the Info.plist file - please let me know.

     
  • CaPro

    CaPro - 2009-06-17

    Hello,

    both solutions don't work for me. I have the latest Java update installed (Java for Mac OS X 10.5 Update 4).

    Is there another possibility?

    First I get the error: Cannot load 32-bit SWT libraries on 64-bit JVM

    If I change the JVMVersion to 1.5* and insert the LSArchitecture line I get the error:

    /Applications/PasswordSafeSWT.app/Contents/MacOS/JavaApplicationStub
    [JavaAppLauncher Error] CFBundleCopyResourceURL() failed loading
    MRJApp.properties file
    [LaunchRunner Error] No main class specified
    [JavaAppLauncher Error] CallStaticVoidMethod() threw an exception
    Exception in thread "main" java.lang.NullPointerException
    at apple.launcher.LaunchRunner.run(LaunchRunner.java:112)
    at apple.launcher.LaunchRunner.callMain(LaunchRunner.java:50)
    at
    apple.launcher.JavaApplicationLauncher.main(JavaApplicationLauncher.java:61)

    Best regards

    CP

     
  • CaPro

    CaPro - 2009-06-17

    Hello again,

    I've inserted the line "LSArchitecture" at the wrong position.

    But after correcting my fault I get still the error: Cannot load 32-bit SWT libraries on 64-bit JVM

    Best regards

    CP

     
  • Nobody/Anonymous

    0.8-beta1 implements step a) of the suggested workaround, so only Java 5.0 will be launched. But there is a 64bit Java 5.0 version installed on Intel Mac's with 64bit CPU. So the issue is not solved completely.

    I now think the correct fix would be to set JVMArchs in Info.plist and to revert JVMVersion to 1.5* (see http://developer.apple.com/java/javaleopard.html)

    <key>JVMArchs</key>
    <array>
    <string>i386</string>
    <string>PPC</string>
    </array>

    -Alexander

     
  • Nobody/Anonymous

    Another fix would be to switch to SWT-Cocoa

    https://bugs.eclipse.org/bugs/show_bug.cgi?id=252644

    -Alexander

     
  • CaPro

    CaPro - 2009-06-18

    Hi nobody,

    the solution

    <key>JVMArchs</key>
    <array>
    <string>i386</string>
    <string>PPC</string>
    </array>

    works for me.

    Thx for your support

    CP

     
  • Tristan Nixon

    Tristan Nixon - 2009-06-21

    Thanks caprom - that does the trick! I've made a new 0.8-beta-1 build for OS X with this fix. Closing this issue.

     

Log in to post a comment.

MongoDB Logo MongoDB