March 19th, 2012

Bigger hammer

How to force Java applications to run in 32 bit mode on Mac OS X

I'm writing this mainly so that Google will index it and hopefully it will provide the solution for anybody else who runs into the same problem.

If you have a Java application on Mac OS X that is contained in an application bundle created using Jar Bundler, it includes a native executable in that automatically runs the JRE in 64 bit mode when you run it on a 64 bit capable Mac. You can check if this has happened by running your application and looking at the Kind column in Activity Monitor.

My problem was that my Java application was trying to integrate with Open Office, which is currently a 32 bit only application. My program, running in 64 bit mode, tried to dynamically load the OO libraries and failed because they are only available in 32 bit format. I didn't discover this during development because I have a 2006 vintage Mac Mini that only has a 32 bit processor and a 2003 vintage iBook that has a G4 PPC processor. One of my beta testers had a newer Mac and was unable to get the program to output anything to OpenOffice. Collapse )