Getting the Arduino IDE running on Mac OS X with 64-bit Java

January 29th, 2009  |  Published in tip  |  6 Comments

The other day I ordered an Arduino Duemilanove from Maker Shed and in anticipation of its arrival I went and downloaded the Arduino software to play around with.  I ran it and immediately got this error, which has been reported a number of times in the forums and mailing lists:

java.lang.UnsatisfiedLinkError: /Users/kylesm/Downloads/arduino-0012/Arduino 12.app/Contents/Resources/Java/librxtxSerial.jnilib:  thrown while loading gnu.io.RXTXCommDriver

I tried rebuilding rxtx with 64-bit support as documented here and here and then overwrote the copy that shipped with Arduino but continued to get the same error.  I then got the idea of copying the library and JAR from Processing (upon which it’s based) since that works just fine.  Same error.

The final trick was to edit the Info.plist for the app and change the value for the JVMVersion property to 1.5* (which is what Processing does) and it worked perfectly because the 32-bit version of the JDK 1.5 is my second choice in the Java Preferences app:

Mac OS X Java preferences

So in the end I couldn’t get it working with a 64-bit JVM and didn’t need to rebuild rxtx, but thankfully Apple includes just about every version it’s ever produced so it wasn’t a big deal.

The problem is primarily due to the fact that the Arduino IDE uses a native library that was built without 64-bit support and I’ve got Apple’s 64-bit JVM set as my default for work.

Tags: , , , ,

Responses

  1. chas says:

    January 30th, 2009 at 5:10 pm (#)

    Kyle,

    thanks for the tip… saved a lot of troubleshooting and guess work

    Here is a way to carry out the tip:

    find java preferences under Applications/Utilities/Java…

    found I had a similar version listing as Kyle

    in terminal I descended the arduino directories to find the Info.plist, from the directory containing your arduino folder you can cd as follows:

    cd arduino-0012/Arduino 12.app/Contents/

    I used the pico editor to edit and save the file Info.plist, changing the following line which is near the end of file (see below)

    pico Info.plist

    1.4+

    to

    1.5*

    (note 1.5+ didn’t work, had to be 1.5*)

    and it now works

    –last about 15 lines of edited Info.plist file, only change was to 2nd line you see here—

    JVMVersion
    1.5*
    MainClass
    processing.app.Base
    Properties

    apple.laf.useScreenMenuBar
    true
    arduino.app-resources
    $APP_PACKAGE/Contents/Resources

  2. kyle says:

    January 30th, 2009 at 6:03 pm (#)

    @chas: Thanks for taking the time to write up the steps.

  3. Matthew Buckett says:

    April 15th, 2009 at 4:48 pm (#)

    Just had the same problem with version 15 and the fix worked a treat. Thanks.

  4. garret linn says:

    June 23rd, 2009 at 11:29 pm (#)

    mrbill
    says:

    Re: Arduino 16 and Apple new Java update
    Reply #2 – 16.06.2009 at 17:10:50 Select the application file in the Finder and then Get Info on it by either selecting “Get Info” in the File menu, or hitting cmd-I. In the info window, check the, “Open in 32 Bit Mode” checkbox and close the window. Now it should work.

  5. Chad says:

    July 23rd, 2009 at 1:35 am (#)

    Arduino ran find 2 weeks ago. I expect that I may have had a Java upgrade (but no sure). Now I get the message
    “cannot launch Java application
    Uncaught exception in main method:
    java.lang.UnsatisfiedLinkError: /Users/
    chadpennebaker/Desktop/arduino & iPhone/Arduino
    16.app/Contents/Resources/Java/librxtxSerial.jnilib:
    no suitable image found. Did find: /Users/
    chadpennebalker/Desktop/arduino & iPhone/Arduino
    16.app/Contents/Resources/Java/librxtxSerial.jnilib:
    no matching architecture in universal wrapper”

    I have set Java Preferences to ‘Open in 32 Bit Mode’; however, I still have the same problem.

  6. Chad says:

    July 23rd, 2009 at 1:53 am (#)

    Scratch my question…
    I had changed java Preferences to 32 Bit mode.
    Should have changed Arduino to 32 bit mode.

    Sorry to bother you…

Leave a Response