path中没有rxtxSerial

path中没有rxtxSerial

本文介绍了java.lang.UnsatisfiedLinkError:加载gnu.io.RXTXCommDriver时抛出的java.library.path中没有rxtxSerial的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

立即使用Fedora(已安装软件包已安装软件包rxtx-2.2-0.5.20100211.fc15.i686,最新版本为
)。

Fedora using right now (package is installed Package rxtx-2.2-0.5.20100211.fc15.i686 already installed and latest version).

我用过/尝试过:

# locate librxtxSerial
/home/sun/Downloads/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so
/home/sun/Downloads/rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so
/home/sun/Downloads/rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so
/home/sun/Downloads/rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib
/home/sun/Downloads/rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so
/home/sun/Downloads/rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so
/home/sun/Downloads/rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so
/home/sun/Downloads/rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so
/usr/lib/rxtx/librxtxSerial-2.2pre1.so
/usr/lib/rxtx/librxtxSerial.so

然后使用:

-Djava.library.path=/usr/lib/rxtx/librxtxSerial.so -Djava.library.path=/usr/lib/jni

但是我总是得到以下结果:

But still i get always this following:

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
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1681)
    at java.lang.Runtime.loadLibrary0(Runtime.java:840)
    at java.lang.System.loadLibrary(System.java:1047)
    at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:83)
    at main.Tty.sendCommand1(Tty.java:212)
    at main.Tty.main(Tty.java:236)

如何解决这个问题?

F ollow up:

错误:

-Djava.library。 path = / usr / lib / rxtx -Djava.library.path = / usr / lib / jni

CORRECT

-Djava.library.path = / usr / lib / jni -Djava.library.path = / usr / lib / rxtx

推荐答案

我想问题是你有多个 -Djava.library.path 参数,第二个是覆盖第一个的值。该值也应该是包含库的文件夹的路径,不包括库名。

I guess the problem is that you have multiple -Djava.library.path parameters and the second one is overwriting the value of the first. The value should also be the path to the folder containing the library, not including the library name.

在linux系统上,您应该能够使用冒号组合两个路径参数作为分隔符:

On linux system you should be able to combine both path parameters using a colon as separator:

-Djava.library.path=/usr/lib/rxtx:/usr/lib/jni

这篇关于java.lang.UnsatisfiedLinkError:加载gnu.io.RXTXCommDriver时抛出的java.library.path中没有rxtxSerial的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 22:45