首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >JavaPOS -爱普生T88IV- UnsatisfiedLinkError在Eclipse中的应用

JavaPOS -爱普生T88IV- UnsatisfiedLinkError在Eclipse中的应用
EN

Stack Overflow用户
提问于 2014-01-30 19:21:01
回答 2查看 2.5K关注 0票数 0

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

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

代码语言:javascript
复制
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) {
        }
    } 
}

但我收到了这些错误:

代码语言:javascript
复制
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)

可以用"CheckHealth.bat“打印一些东西。

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

诚挚的问候

米因泽尔马森

  • 我使用的是Winwos8.1(64位)
  • 热敏打印机采用USB接口。
  • 爱普生JavaPOS ADK的版本为1.13.15。
  • 安装了最新的32位Java版本的Java JDK和JAI。
EN

回答 2

Stack Overflow用户

发布于 2014-06-24 07:16:24

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

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

代码语言:javascript
复制
java.exe -Djava.library.path=c:\path\to\dlls\ -cp c:\my\class\path my.app.Main

编辑

您需要指定的路径是存储DLL jp_co_epson_upos_firm_FirmNativeAccess*.dll的目录。爱普生JavaPOS ADK的安装例程将这些文件存储在安装ADK时指定的JRE的bin目录中。

票数 1
EN

Stack Overflow用户

发布于 2014-03-28 21:26:45

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21465607

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档