HelloDatalogicJavaPOS
Hello World program for Datalogic JavaPOS
HelloDatalogicJavaPOS initiates a scanner beep with Datalogic JavaPOS. The latest release of JavaPOS can be downloaded from the Datalogic website here.
The HelloDatalogicJavaPOS repository contains the HelloDatalogicJavaPOS.java source and shell scripts to run the HelloDatalogicJavaPOS.jar you build. The repository also has a NetBeans IDE (Integrated Development Environment) project to perform the build. Other IDEs can be used.
Steps to build and run HelloDatalogicJavaPOS.jar:
-
Install Datalogic JavaPOS. This install includes the JavaPOSTest program.
-
Make sure Datalogic JavaPOS runs with your scanner. With your scanner and JavaPOSTest do an Open, Claim, and Execute Direct I/O Beep. Not all interfaces support Direct I/O beep. In that case skip the beep.
-
Clone or download the HelloDatalogicJavaPOS repository.
-
Build HelloDatalogicJavaPOS.jar. This was originally done with the following. Variations near these should work.
- Apache NetBeans 11.0
- Java jdk1.8.0_231
- The HelloDatalogicJavaPOS project in NetBeans is a Java with Ant, Java Application project. The build uses a library of the JavaPOS's .jar files. These .jar files are in the JavaPOS install's root directory where it has its JavaPOS.jar and its SupportJars directory. Create this library via NetBeans -> Tools -> Libraries. Add the library to the HelloDatalogicJavaPOS NetBeans project via its Properties -> Libraries -> Classpath + -> Add Library...
Another variation here builds HelloDatalogicJavaPOS.jar without requiring the Apache NetBeans 11.0 Integrated Development Environment (IDE). It instead builds with the included script BuildHelloDatalogicJavaPOS.cmd or BuildHelloDatalogicJavaPOS.sh. These scripts explicitly use the Java JDK's javac and jar programs and require no intermediary IDE. Related "inside" scripts show what is inside HelloDatalogicJavaPOS.jar and Datalogic's JavaPOS.
-
Update the jpos.xml of your installed JavaPOS to include a
<JposEntry logicalName="DatalogicJavaPOSDevice">
entry for your scanner and interface. This entry is a copy of the entry you used with JavaPOSTest above. The only difference is the logicalName is changed toDatalogicJavaPOSDevice
. -
With HelloDatalogicJavaPOS.jar make your scanner beep. Use the appropriate HelloDatalogicJavaPOS script:
- Windows
- Linux
.cmd.sh