0

I am having a problem when I try to use my Arduino in my java application when I export it to a runnable jar file. When I run the application on the IDE it runs just fine, the exported jar on the same machine too, but when I run it on a different machine I get a the

java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path.

I am sure that I have added the RXTXcomm.jar and the rxtxserial.dll to the build path as shown in the picture below build path

In the other machines where I put my jars, I copy mentioned two files in the exact same location but the error persists.

Krzysztof Krasoń
  • 26,515
  • 16
  • 89
  • 115
user3382344
  • 177
  • 1
  • 1
  • 8
  • Have you set the `java.library.path` ? http://stackoverflow.com/questions/661320/how-to-add-native-library-to-java-library-path-with-eclipse-launch-instead-of – Marged Oct 14 '15 at 19:30
  • Your jar file needs the RXTXcomm.jar in its classpath at runtime as well... unless you're using something to build an uber jar for it. I believe common Java build systems like Maven and Gradle have plugins to build uber-jars. – Powerlord Oct 14 '15 at 19:31
  • Yes, I added the the RXTXcomm.jar and the rxtxserial.dll in the build path, there are a link of an image showing this in my question. – user3382344 Oct 14 '15 at 19:34
  • @Powerlord thank you I am going to try to build with Maven but I thought the simplest way to achieve this is to always copy past the needed files in the same location of your build path, in my app I have another library (jmf) and it runs on every machine with this method – user3382344 Oct 14 '15 at 19:38

1 Answers1

0

You have to copy the contents of the RXTXcomm.jar into the exported JAR-File.

Place the dlls into jre_home/bin/ or in your programs main folder.

Friwi
  • 482
  • 3
  • 13