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

I am trying to use the rxtx serial communication library on debian and I added librxtx.so to the path of my native library, but still this exception has occurred.

java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1738) at java.lang.Runtime.loadLibrary0(Runtime.java:823) at java.lang.System.loadLibrary(System.java:1028) at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:83) at com.vxoom.qit.basic.Log4jInit.startPrinterThread(Unknown Source) at com.vxoom.qit.basic.Log4jInit.init(Unknown Source) at javax.servlet.GenericServlet.init(GenericServlet.java:39) atwinstone.ServletConfiguration.ensureInitialization(ServletConfiguration.java:183) at winstone.WebAppConfiguration.<init>(WebAppConfiguration.java:918) at winstone.HostConfiguration.initWebApp(HostConfiguration.java:131) at winstone.HostConfiguration.<init>(HostConfiguration.java:73) at winstone.HostGroup.initHost(HostGroup.java:85) at winstone.HostGroup.<init>(HostGroup.java:45) at winstone.Launcher.<init>(Launcher.java:196) at winstone.Launcher.main(Launcher.java:391) 
+4
source share
4 answers

For me, the solution was to copy the link to the library to where jvm can see it like this:

 cp '/usr/lib/jni/librxtxSerial.so' '/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/i386' 
+3
source

Set LD_LIBRARY_PATH to the directory in which you have the .so file.

Specify the directory where you have the .so /home/abc file

Use this command:

 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"/home/abc" 

In java, download .so as follows.

 System.loadLibraryPath("rxtxSerial"); 

To install it permanently, you must put the same line in the .profile file that will be in your home directory.

you can refer to this guide

0
source

I will copy and paste the rxtx INSTALL help

 Solution 1: move the file to a place that works $ mv /usr/local/lib/librxtxSerial.* /usr/local/java/jre/lib/i386/ Solution 2: add the location of librxtxSerial to LD_LIBRARY_PATH $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/ Solution 3: pass the location in on the command line $ java -Djava.library.path=/usr/local/lib/ ... 

A source

http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL

0
source

You need to put the rxtxSerial.dll file in the jreXX / bin folder

0
source

All Articles