我创建了一个小程序,RXTXComm.jar
用于从 COM 端口读取值。当我在 Eclipse IDE 中将小程序作为小程序运行时,它正在工作。但是当我通过我的应用程序运行它时,它在小程序控制台中给出了这个错误:
java.lang.ExceptionInInitializerError thrown while loading gnu.io.RXTXCommDriver
Exception in thread "Thread-17" java.lang.ExceptionInInitializerError
at comPortListen.run(comPortListen.java:65)
at java.lang.Thread.run(Unknown Source)
Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission loadLibrary.rxtxSerial)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkLink(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:83)
可能是什么问题呢?