Sunday, November 01, 2009

Using 32-bit SWT with Mac OS X Snow Leopard

I just ran into a problem with Eclipse 3.4.2 on Mac OS X Snow Leopard. Attempting to run or debug an Eclipse application, I got the error message "Cannot load 32-bit SWT libraries on 64-bit JVM".

Turns out that the old Eclipse versions (pre-3.5) are 32-bit, and Java 6 in Snow Leopard runs 64-bit by default. There seems to be multiple solutions to the problem, but the easiest in my case was to add "-d32" on the "Program arguments" list on the run configuration (the solution described here).

Run configuration