JavaPOS-Epson TM-T88IV-Eclipse中不满意的链接错误

JavaPOS-Epson TM-T88IV-Eclipse中不满意的链接错误,eclipse,printing,unsatisfiedlinkerror,epson,javapos,Eclipse,Printing,Unsatisfiedlinkerror,Epson,Javapos,我买了一台爱普生TM-T88IV热敏打印机。我使用安装手册安装了Epson JavaPOS ADK 然后,我在Eclipse中添加了Epson JavaPOS的lib文件夹中的Jar文件,并编写了一个连接到打印机的简单程序 public class MainClass { public static void main(String[] args) { //System.out.println("Ausgabe aus der main()-Methode")

我买了一台爱普生TM-T88IV热敏打印机。我使用安装手册安装了Epson JavaPOS ADK

然后,我在Eclipse中添加了Epson JavaPOS的lib文件夹中的Jar文件,并编写了一个连接到打印机的简单程序

public class MainClass { 
    public static void main(String[] args)
    { 
        //System.out.println("Ausgabe aus der main()-Methode"); 

        POSPrinterControl113 ptr = (POSPrinterControl113)new POSPrinter();

        try {
            //Open the device.
            //Use the name of the device that connected with your computer.
            ptr.open("EPSON_TM_T88IV");

            //Get the exclusive control right for the opened device.
            //Then the device is disable from other application.
            ptr.claim(1000);

            //Enable the device.
            ptr.setDeviceEnabled(true);
        }
        catch(JposException ex) {
        }
    } 
}
但我收到了这些错误:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no jp_co_epson_upos_firm_FirmNativeAccess_1_13_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_13_0001.pntr.CommonPrinterService.<clinit>(CommonPrinterService.java:1004)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at jp.co.epson.uposcommon.util.EpsonJposServiceInstanceFactory.createInstance(EpsonJposServiceInstanceFactory.java:142)
    at jpos.loader.simple.SimpleServiceConnection.connect(Unknown Source)
    at jpos.BaseJposControl.open(Unknown Source)
    at MainClass.main(MainClass.java:15)
线程“main”java.lang.UnsatifiedLinkError中出现异常:java.library.path中没有jp_co_epson_upos_firm_FirmNativeAccess_1_13_0001
位于java.lang.ClassLoader.loadLibrary(未知源)
位于java.lang.Runtime.loadLibrary0(未知源)
位于java.lang.System.loadLibrary(未知源)
在jp.co.epson.upos.core.v1_13_0001.pntr.CommonPrinterService.(CommonPrinterService.java:1004)
位于java.lang.Class.forName0(本机方法)
位于java.lang.Class.forName(未知源)
位于jp.co.epson.uposcommon.util.epsonjposerviceinstancefactory.createInstance(epsonjposerviceinstancefactory.java:142)
位于jpos.loader.simple.SimpleServiceConnection.connect(未知源)
在jpos.BaseJposControl.open(未知源代码)
在MainClass.main(MainClass.java:15)
可以打印带有“CheckHealth.bat”的内容

有人有办法解决这个问题吗

致意

梅恩泽尔曼森

  • 我正在使用Windwos 8.1(64位)
  • 热敏打印机通过USB连接
  • EPSON JavaPOS ADK的版本是1.13.15
  • 安装了Java JDK和JAI的最新32位Java版本

您只需将带有爱普生驱动程序文件的dir(jp_co_epson_upos_firm_FirmNativeAccess_1_13_0001.XX)包含到类路径中,例如,在centos中,您需要转到/home/username/.bash_配置文件并添加导出LD_库路径=/opt/EpsonJavaPOS/bin

java.lang.unsatifiedlinkError意味着java找不到所需的系统库。“系统库”在本例中不是指jar库。“系统库”指操作系统的库文件(Windows上的DLL)

您需要更改(在Windows上)PATH变量并添加正确的目录,其中存储了所需的Epson JavaPOS DLL。或者,您也可以在启动Java应用程序时使用“-Djava.library.path”参数设置正确的路径,例如:

java.exe -Djava.library.path=c:\path\to\dlls\ -cp c:\my\class\path my.app.Main
编辑

您需要指定的路径是存储dll
jp_co\u epson\u upos\u firm\u FirmNativeAccess*.dll
的目录。Epson JavaPOS ADK的安装例程将这些文件存储到JRE的bin目录中,您在安装ADK时指定了该目录