I'm using RXTX in my Java application which includes a JNI library. I placed the .jni file in /Libray/Java/Extensions
. When I start my application manually via the usual java -jar /path/to/app.jar
everything works fine. However when I try to start it via Netbeans or Ant it fails with
[java] 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] Exception in thread "main" 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 [java] at java.lang.ClassLoader$NativeLibrary.load(Native Method) [java] at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1823) [java] at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1738) [java] at java.lang.Runtime.loadLibrary0(Runtime.java:823) [java] at java.lang.System.loadLibrary(System.java:1045) [java] at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:83)
Analogue behaviour when I move the .jni somewhere else and point the JVM to it using -Djava.library.path
. It works manually but fails with Ant.
I'm using Java 1.6 64Bit, Ant 1.7.1, RXTX 2.1-7r2 (stable) running Mac OS X 10.6.4