Reputation: 1137
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");
Upvotes: 2
Views: 3726
Reputation: 240966
.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
Upvotes: 2