现在我尝试编写一个使用Epson Java Pos ADK的Java应用程序。
我所做的:
-已安装Java 1.6.0_22
-已安装Java JDK
-已安装的Eclipse
-安装了Epson Java Pos ADK 1.11.8
然后我用Com端口工具试了试我的打印机,我给他发送十六进制字符,看看是否一切正常。是的!
然后我开始开发我的应用程序。在
jpos.xml
我使用了Epson Java Pos ADK包中的SetupPOS生成器。
我用了几行代码从我的应用程序中打印了一个测试:
posPrinter = new POSPrinter();
posPrinter.open("##THE_NAME_I_SET_IN_JPOS_XML##");
posPrinter.claim(0);
posPrinter.setDeviceEnabled(true);
posPrinter.printNormal(station, "xxxxxxxxxxxxxxxxxx\n");
posPrinter.cutPaper(0);
posPrinter.release();
posPrinter.setDeviceEnabled(false);
posPrinter.close();
但这个应用程序的结果是:
jpos.JposException:它不是
已初始化。在
jp.co.epson.upos.pntr.CommonPrinterService.checkInitialized(未知
来源)在
jp.co.epson.upos.pntr.CommonPrinterService.sendOutputData(未知
来源)在
jp.co.epson.upos.pntr.CommonPrinterService.sendOutputData(未知
来源)在
jp.co.epson.upos.pntr.CommonPrinterService.executeNormalPrint(未知
来源)在
jp.co.epson.upos.pntr.CommonPrinterService.printNormal(未知
来源)在
jpos.POSPrinter.printnorm(未知
来源)在
打印机(Printer.java:146)位于
Main.Main(Main.java:28)
我在两台不同的电脑(Vista和XP 32bit)上试过,有相同的版本和工具,但总是一样的。
我还尝试了JavaPos示例测试应用程序和EpsonHealtCheckTool。这个工具也一样。
不知道还能尝试什么,大家都知道这个问题吗?
PS:我的打印机Epson TM-U220A,串行连接似乎正常,因为当我试图声明打印机和另一个应用程序使用COM端口时,我的应用程序说该端口不可用。
谢谢。