Posted in Apple, General, OSX
03/22 2010

Cannot load 32-bit SWT libraries on 64-bit JVM

If you get this error running Flash Builder or Eclipse on OSX Snow Leopard, it’s because there’s a mismatch between the libraries bundled with the plugin involved and the JVM of the OS. To fix, do one of the following:

1. For Eclipse, go to Eclipse -> Preferences -> Java -> Installed JRE
2. For Flash Builder, go to Flash Builder -> Preferences -> Java -> Installed JREs

Then, edit the selected Java VM, adding the following value for the Default VM Arguments field
-d32

This just forces the JVM to default to the 32-bit version. Once that’s been done, that error message should be no more…

This Post tags:

 

USER COMMENTS

Track comments via RSS 2.0 feed. Feel free to post the comment, or trackback from your web site.

  1. 03/22 2010

    Awesome, that was it. Thanks for sharing.

  2. 03/22 2010

    Wow! This post just saved me from a serious headache. Thank you!

  3. 03/22 2010

    Dude!
    You just saved me SOOOOO much time.
    Thanks heaps and stacks!

  4. Jayprakash
    03/22 2010

    I am working on eclipse and unable to navigate to “settings”
    in the below path. Where is Eclipse in the menu? What version of eclipse are you using?

    Eclipse -> Settings -> Java -> Installed JRE

  5. Jayprakash
    03/22 2010

    I have found what you said and did exactly that but i got an error saying “Unrecognized Option: -d32″
    “could not create virtual machine”

  6. 03/22 2010

    Sorry for the confusion Jay. That should read:

    Eclipse -> Preferences -> Java -> Installed JRE

    I’ll update the post as well…

  7. ali qader
    03/22 2010

    I have found what you said and i did exactly that but i get error dialogs box (could not create the Java virtual machine) and when i click on the OK button on the dialogs box in the Eclipse show this message

    Unrecognized option: -d32

    please i need help to fix this error.

  8. 03/22 2010

    Sorry to hear about your troubles Ali. Would be glad to help. Can you share more info about your environment?

    FYI, I’m on OSX 10.6.4 and have tried this option w/Eclipse 3.5.2 and 3.6 and JVMs 1.5 and 1.6 and couldn’t reproduce.

    Do you still get the error after rebooting your system and launching Eclipse?

  9. jdf
    03/22 2010

    Thanks a lot!

  10. Dazee Eli
    03/22 2010

    Hi Ali, I encountered the same problem you had and fixed it. For your information, I’m running windows 7 64 bit. I actually have two jre installed on my system. One is located in program files/java the other is in program files(86)/java. The problem occur because I was using the 64 bit jre located in program files (note not 86). So I added a new jre to eclipse project from the program files(86)/java and used that jre to build and it works.

  11. Theodore
    03/22 2010

    For me, on OSX 10.5.8, the -d32 flag does absolutely nothing.

    If I select JRE 1.6 as the runtime environment, the -d32 flag is ignored (there’s no Java 32-bit available for mac for 1.6, afaik, so it has to ignore it and attempt to run in 64-bit mode), and I get this error.

    If I select JRE 1.5, it doesn’t matter whether I set the -d32 flag, as the default is 32-bit for the 1.5 JRE, at least on this version.

    So, for me, the solution was to switch to 1.5/Java 5 in the compiler compliance and 1.5 for the JRE.

  12. Rick
    03/22 2010

    Dude, thank you so much! I was pulling my hair out trying the different VMs that come with Mac OSX (my ver: 10.6.6). This totally solved my issue.

  13. Kelly
    03/22 2010

    An update to Dazee’s comment above for Win 7 64bit. The actual folder name for the 32bit version is “Program Files (x86)” not “Program Files(86)” The space and the x are important.

  14. 03/22 2010

    Excellent mate, it was a very direct clue to the problem. Also this -d32 can be added from “run configurations->arguments->VM arguments

  15. Montecchyo
    03/22 2010

    Thx for sharing, and thx to hashem too.

Get Adobe Flash playerPlugin by wpburn.com wordpress themes