Leopard Java D.I.Y. (Destroy-it-yourself) with 6.0 and -10810
September 20th, 2008
This isn't really a web issue, but it's not something I found any help with on Google so I thought I'd share here (as we are Mac users at ArDes).
I recently installed Matlab for Uni work and it wouldn't load, seemingly with Java issues, complaining of being unable to load a native library. I then noticed that Vuze and TuxGuitar also wouldn't load, yet I could run a simple Java application I'd written without error.
This was odd, and worried me. However, it turned out to be quite simple, and something I'd caused myself by trying to be clever. It's to do with the Leopard Java 6 runtime environment which you may have installed as an update a few months ago.
If after doing this you may have gone into Java Preferences and told it to use this new runtime environment as the default things probably stopped working. The trouble is it's 64-bit only, which causes compatibility issues with 32-bit code (such as the windowing/graphics library SWT that you see in many applications).
Symptoms
- Java applications won't load
- Error -10810 given in console when using open -a /Applications/appname.app and elsewhere
- Reports of 64bit SWT issues in the Console (which you can find with spotlight, in /Applications/Utilities/ )
Console log content
- [JavaAppLauncher] A 64-bit JVM is available for 1.6.0
- [JavaAppLauncher] and it is the only version available
- [JavaAppLauncher] JVMArchs not found in Java dictionary
- java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM
Solution
Search for Java Preferences in spotlight (/Applications/Utilities/Java/ ) and when it loads set Java version back from Java SE 6 to J2SE 5.0 Make sure that you put 5.0 above 6.0 (64-bit) for applets too or you'll have the same problems with things like the Matlab student product activation applet.
Good luck!
2 Responses to “Leopard Java D.I.Y. (Destroy-it-yourself) with 6.0 and -10810”
Sorry, comments are closed for this article.
Anders Says:
January 30th, 2009 at 11:04 PM
You can also edit the applications Info.plist file specifying that the app would like to run a 32 bit Java. Add the following under the <dict> tag:
<key>JVMArchs</key> <array> <string>i386</string> </array>This helped me running Vuze while still having my 64-bit java set to default!
/Anders
mr.b. Says:
April 10th, 2009 at 04:30 AM
Thanks for this tip. I spent about an hour before I found this.
My own fault for trying to get Weblogic running on OSX I guess ;-)