0

I just added "-Djava.library.path=" to the "VM Arguments" under Run Configuration in Eclipse and everything works fine until I tried to add an external JAR file. I get the following 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

Am I not setting something properly in Eclipse?

Kara
  • 6,115
  • 16
  • 50
  • 57
Petezah
  • 1,465
  • 4
  • 26
  • 30

3 Answers3

2

If your interested I forked RXTXserial a while back since thier update "schedule" sucks. I have just ported it over to the Android platform too. We decided to move the native libs into the jar and use reflection to deploy them. The API is the same as RXTX, but everything just works. You can find jars and full project sources at: http://code.google.com/p/nrjavaserial/

0

Appearently that external library has a dependancy with another class gnu.io.RXTXCommDriver . Perhaps you will need to add that library to class path.

Chathuranga Chandrasekara
  • 20,548
  • 30
  • 97
  • 138
0

The exception indicates that the class gnu.io.RXTXCommDriver tries to load a native library, which would be named rxtxSerial.dll on Windows and rxtxSerial.so on Linux, and the JVM cannot find it in the directories listed in java.library.path. Have you tried to add a JAR containing the library to java.library.path? I don't think that's possible, it has to be a directory containing the extracted library file.

Michael Borgwardt
  • 342,105
  • 78
  • 482
  • 720
  • 1
    It seems the "proper" way to do this in Eclipse is to set the **Native Library Location** in the `RXTXcomm.jar` in the **Java Build Path** section of the project properties. I got it from here: http://stackoverflow.com/questions/957700/how-to-set-the-java-library-path-from-eclipse – Hans-Christoph Steiner Jul 16 '11 at 00:23