我最近买了一台Epson TM-T20打印机,我正在尝试构建一个可以利用它的
java应用程序.我安装了打印机附带的
JavaPOS,并将相关的.jar文件添加到我的构建路径中.尽管如此,在尝试运行与其一起打包的一些示例示例时,我仍然遇到此错误.
Exception in thread “AWT-EventQueue-0” java.lang.UnsatisfiedLinkError: no jp_co_epson_upos_firm_FirmNativeAccess_1_11_0001 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 jp.co.epson.upos.core.v1_11_0001.pntr.CommonPrinterService.(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at jp.co.epson.uposcommon.creator.EpsonJposServiceInstanceFactory.createInstance(Unknown Source)
at jpos.loader.simple.SimpleServiceConnection.connect(Unknown Source)
at jpos.BaseJposControl.open(Unknown Source)
at Step1Frame.processWindowEvent(Step1Frame.java:79)
at java.awt.Window.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(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$200(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 Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
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 Source)
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)
其他信息
>操作系统:W7 x64
> IDE:Eclipse Juno Service Release 1 x64
>安装最新的JDK
> JavaPOS有一个名为setupPOS的应用程序.我还在此设置中添加了我的打印机
任何帮助将不胜感激.谢谢
最佳答案 根据
java documentation,UnsatisfiedLinkError异常是:
Thrown if the Java Virtual Machine cannot find an appropriate
native-language definition of a method declared native.
根据SO中的另一个问题,您可以阅读here,问题可能出在您的库路径中.尝试包含该选项
-Djava.library.path=./XXX
其中./XXX是存储打印机驱动程序的相对路径或完整路径(jp_co_epson_upos_firm_FirmNativeAccess_1_11_0001.dll或.so所在的目录).
祝好运!