2

Ok, im using rxtx library to connect to rs232 and it works well in eclipse. But when i export my project to .jar file i've got an error UnsatisfiedLinkError: no rxtxSerial in java.library.path. As i know i need to add this dll file to java.library.path and this works well if i put for example in C:/Windows/. The question is how to load this library for a jar file folder. I was trying to System.load() and adding folder localization to java.library.path and then System.loadlibrary() but even then it can't find library.

Was trying:

//System.setProperty("java.library.path", "C:\\asd_lib" + File.pathSeparator + 
//  System.getProperty("java.library.path"));
//System.out.println(System.getProperty("java.library.path"));
//System.loadLibrary(rxtxSerial);
//System.load("C:\\asd_lib\\rxtxSerial.dll");
Gravian
  • 957
  • 2
  • 11
  • 20

1 Answers1

3

.dll in jar is no longer a physical file, You would have to extract it to a physical file and then you can load it from that location

Community
  • 1
  • 1
jmj
  • 237,923
  • 42
  • 401
  • 438