2012-12-19 100 views
4

我試圖使用RXTX串口通信庫在Debian,我已經librxtx.so加入到機庫路徑,但仍然發生此異常。java.lang.UnsatisfiedLinkError中:沒有rxtxSerial中的java.library.path的debian

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) 
+0

請有人幫助我.... – Nutan

回答

0

設置LD_LIBRARY_PATH到你有.so文件的目錄。

讓您擁有.so文件/home/abc

使用此命令的目錄:

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

在java中加載以下方式中的.so ..

System.loadLibraryPath("rxtxSerial"); 

要永久設置它,您必須將.profile文件 中的相同行放入您的家庭導演年。

you can refer to this guide

+1

如何設置LD_LIBRARY_PATH ??? – Nutan

+0

導出是命令設置LD_LIBRARY_PATH .. @ Pooja – gks

+1

沒有這是行不通的:(.... – Nutan

0

我會複製並粘貼RXTX INSTALL幫助

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/ ... 

來源

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

3

對我來說,解決辦法是將鏈接複製到圖書館,其中jvm可以這樣看待它:

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

你需要把rxtxSerial.dll到jreXX/bin文件夾

相關問題