Loading...
Logo
Processing Forum
hello,

i'm trying for the last hours to get the serial library running in eclipse (Eclipse IDE for Java Developers Version 1.2.1.20090918) on macbookpro mac osx 10.6.4 to get connected to my arduino board.

what i've done yet:

i imported the
  • core.jar
  • serial.jar
  • RXTXcomm.jar

copied librxtxSerial.jnilib to MacintoshHD/Library/Java/Extensions/
linked RXTXcomm.jar to librxtxSerial.jnilib (by choosing RXTXcomm.jar - properties - Native library: Location path: /Library/Java/Extensions)

when i run the programm, i get this error:

java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib:  no suitable image found.  Did find:  /Library/Java/Extensions/librxtxSerial.jnilib: no matching architecture in universal wrapper thrown while loading gnu.io.RXTXCommDriver
java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib:  no suitable image found.  Did find:  /Library/Java/Extensions/librxtxSerial.jnilib: no matching architecture in universal wrapper
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1823)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1738)
    at java.lang.Runtime.loadLibrary0(Runtime.java:823)
    at java.lang.System.loadLibrary(System.java:1045)
    at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:83)
    at processing.serial.Serial.list(Serial.java:554)
    at mainClass.setup(mainClass.java:10)
    at processing.core.PApplet.handleDraw(PApplet.java:1571)
    at processing.core.PApplet.run(PApplet.java:1496)
    at java.lang.Thread.run(Thread.java:637)
Exception in thread "Animation Thread" java.lang.RuntimeException: Error inside Serial.ports()
    at processing.serial.Serial.errorMessage(Serial.java:588)
    at processing.serial.Serial.list(Serial.java:569)
    at mainClass.setup(mainClass.java:10)
    at processing.core.PApplet.handleDraw(PApplet.java:1571)
    at processing.core.PApplet.run(PApplet.java:1496)
    at java.lang.Thread.run(Thread.java:637)




my second try was to use the arduino library with the Arduino Firmata.
same imports und link to librxtxSerial.jnilib

when i run the programm, this window pops up and  asks me to chongure gnu.io.rxtx.properties

Now i don't know what to do.

when i just close the window i get the following exception:
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/gnu.io.rxtx.SerialPorts
IOException!


can anybody help me please?
manuel




Replies(6)

i think you could go back to the first try and run your project in 32-bit mode, using the -d32 argument.

oh, and have you tried proclipsing? it's a very useful plugin for the handling of p5 stuff in eclipse.
hey fturchet,
thank you for the answer. i set the java preferences to 32 bit and i don't get the error anymore.
(but can you tell me where to write the -d32 argument)

(I also linked the lib to System/Library/Java/Extensions instead of Library/Java/Extensions)

but now the gnu.io.rxtx.properties window pops up i don't know which ports to check. i can not find a programm, terminal command to show me the port numbers.

i tried to insert the port name "/dev/tty.usbserial-A600af0g", but always get this IOException:

/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/gnu.io.rxtx.SerialPorts
IOException!

I also can not find the gnu.io.rxtx.Serial Ports file at this url: /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/gnu.io.rxtx.SerialPorts


the path to set the argument is: run configurations... > arguments tab > vm arguments.

and to get a list of available serial ports you should use Serial.list().
thank you soooo much! now it works! i've been really desperate the last two days.
Absolutely *do not* ever install rxtx (or other Java code) in /System/..., nor /Library/... (or even ~/Library/), it will break future releases of Processing if you try to run serial sketches after we've updated the serial library.

To make the native libraries work in Eclipse, add the following:

-Djava.library.path=/path/to/serial/library/

so that the native libs are picked up properly.
hello ben fry,

I found it in the old forum to put the "librxtxSerial.jnilib" in /Library/Java/Extensions:
http://processing.org/discourse/yabb2/YaBB.pl?num=1170029680  Reply #7
can you delete or comment this to prevent others.

(i now use proclipsing and it does all imports for me)