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(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:123)
at com.swing.util.SerialReader.open(SerialReader.java:82)
at com.swing.view.Test.openSerialPort(Test.java:58)
at com.swing.view.Test.<init>(Test.java:17)
at com.swing.view.Login.getIcCard(Login.java:115)
at com.swing.view.Login.<init>(Login.java:50)
at com.swing.view.Login.main(Login.java:43)
1、错误原因
缺少rxtxParallel.dll和rxtxSerial.dll文件
2、解决方法
把rxtxParallel.dll、rxtxSerial.dll拷贝到:C:\WINDOWS\system32下。
rxtxParallel.dll 放在%java_home%\jre\lib\ext下
rxtxSerial.dll 放在%java_home%\jre\bin下
3、下载链接:
链接: https://pan.baidu.com/s/15P64qdz2fgBUhL2ZHB4L9Q 提取码: jx2m