I am developing an application in Java using Eclipse IDE. My os is Mac OS 10.12.2 . My application is using the RXTX library (gnu.io.*) for serial communication, added in my pom.xml
<dependency>
<groupId>org.rxtx</groupId>
<artifactId>rxtx</artifactId>
<version>2.1.7</version>
</dependency>
I have added also librxtxSerial.jnilib
file in project by doing this (project->Properties->java buld path->addjars). whenever I run my code it gives me this error:
java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver
Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:83)
You have to add the location of the folder that contains
librxtxSerial.jnilib
as Native library location:librxtxSerial.jnilib
and click OK