5 Replies Latest reply: Jul 3, 2013 7:47 AM by 9ca73076-ce0c-4cfe-bb42-7fd2056c755e RSS

    jpos/res/jpos.properties file not found

    57ad7072-90ed-478e-ac71-66012481733c

      i have this code to put a pos printer working

       

      package javaapplication2;

       

       

      import jpos.*;

       

       

       

       

       

       

      /**

      *

      * @author utilizador

      */

      public class JavaApplication2 {

          POSPrinterControl19 ptr = (POSPrinterControl19)new POSPrinter();

        public static void main(String [ ] args) throws JposException

      {

          // declare a reference

              JavaApplication2 app;

              // create an object

              app = new JavaApplication2();

              // call a method

              app.printReceipt();

             

      }   

       

       

      private  void initPrinter() throws JposException {

          ptr.open("POSPrinter");

          ptr.claim(1000);

          ptr.setDeviceEnabled(true);

          ptr.setMapMode(POSPrinterConst.PTR_MM_METRIC);

      }

      private boolean printerUseable() throws JposException {

          // check if the cover is open

      if (ptr.getCoverOpen() == true) {

          // cover open so do not attempt printing

          System.out.println("printer.getCoverOpen() == true");

          return false;

      }

       

       

      // check if the printer is out of paper

      if (ptr.getRecEmpty() == true) {

          // the printer is out of paper so do not attempt printing

          System.out.println("printer.getRecEmpty() == true");

          return false;

      }

       

       

          return true;

      }

      public  void printReceipt() {

          try {

              initPrinter();

              if (printerUseable()) {

                  ptr.printNormal(POSPrinterConst.PTR_S_RECEIPT, "1\n");

                

              }

          } catch (JposException e) {

          } finally {

              // close the printer object

              try {

                 

                  ptr.close();

              } catch (Exception e) {

          }

               System.out.println("StarReceiptTest finished.");

              System.exit(0);

          }

      }

       

       

        

      }

       

       

      but i when i execute it appears this

      jpos/res/jpos.properties file not found

      jpos/res/jpos.properties file not found

      jpos/res/jpos.properties file not found

      StarReceiptTest finished.

      BUILD SUCCESSFUL (total time: 0 seconds)

      someone can help me ??