我有一个Java程序,并且想使用RTXCommon.jar,所以如果尝试使用它,则会出现此错误

java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while
loading gnu.io.RXTXCommDriver
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: no rxtxSe
rial 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.mcsolution.easyMgmt.panel.utility.panelProgramma.inizializzaLabel
Text(panelProgramma.java:877)
        at com.mcsolution.easyMgmt.panel.utility.panelUtility.creaSwing(panelUti
lity.java:36)
        at com.mcsolution.esp.TestaFrameSalagiochi$MenuLookDemo22$1.actionPerfor
med(TestaFrameSalagiochi.java:118)
        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
        at javax.swing.AbstractButton.doClick(Unknown Source)
        at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
        at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown
Source)
        at java.awt.Component.processMouseEvent(Unknown Source)
        at javax.swing.JComponent.processMouseEvent(Unknown Source)
        at java.awt.Component.processEvent(Unknown Source)
        at java.awt.Container.processEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$400(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
        at java.awt.EventQueue$4.run(Unknown Source)
        at java.awt.EventQueue$4.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)

然后,我右键单击项目,java构建路径,然后找到RTXCommon.jar,选择Native Library Path,进行编辑,然后选择文件夹C:\\ SWInstall \\ dll

在此文件夹中,我复制了rtxSerial.dll rtxParallel.dll。 然后,我运行了该项目并开始工作。 但是,如果我尝试生成jar文件,然后运行它,则会遇到相同的错误。

我该如何解决?

问候

===============>>#1 票数:0

您没有提到的最重要的检查之一就是验证您使用的是32位还是64位的RTXCommon.jar,如果您使用的是Java 82位,则应使用RTXCommon.jar 32位。

然后,您必须检查RTXCommon.jar是否指向本机库的正确位置,为此,在eclipse下,右键单击您的项目并选择属性,然后选择Java构建路径,在对话框中单击之前的小箭头RTXCommon.jar。 双击本机库位置,然后输入DLL的路径。

如果您愿意在不同的计算机上运行您的应用程序,请记住将DLL存储在一个公共文件夹中(例如在Windows的程序文件下),这样可以防止其他用户发生此类错误。 其他操作系统也是如此。

  ask by bircastri translate from so

未解决问题?本站智能推荐: