How to setup JavaPOS with Star Printer on Ubuntu Linux
Introduction
How to use a Star Micronics printer with Ubuntu Linux via the JavaPOS driver. While this was written using a USB TSP650, these directions suffice for the following supported models.
Supported Printers: TSP650II, SP700, TSP700II, HSP7000, TUP500
Supported Interfaces: Serial, Ethernet
Supported Environments: Ubuntu Linux 9.04
Install Java Development Kit
The Java development kit must be installed to use the JavaPOS driver. Click on System at the top menu bar, then Administration/Synaptic Package Manager.
Enter the password if prompted.
Search for sunjava6.jdk in the Quick search field.
When the package appears, right-click on it and click on Mark for Installation.
Click the Mark button.
All other necessary packages will be selected automatically. Click Apply at the top.
Click the Apply button.
The files will download.
Agree to the license terms and click Forward.
Click the Close button.
Open the Synaptic Package Manager again and ensure there is a green box next to sun-java6-jdk.
Downloading and Installing the Star Micronics JavaPOS Driver
Obtain the Star Micronics JavaPOS Package (starjavapos_linux_Ver1.9.13) at our website.
Open the “starjavapos_linux_Ver1.9.13” folder. Right click on “jpos.xml” and click on Open with Text Editor.
Search for your printer model (e.g. TSP654) and copy the Logical Name. USB and Parallel connections require no modification to this file4. If the printer has a Serial or Ethernet interface, skip.
NOTE: There currently is no support for USB printer class for HSP7000, TSP650, TSP700II and SP700. If you have a USB interface, you must select the vendor class logical name and put Dip switch 5 OFF on the printer.
For a serial connection, enter the baud rate. For ethernet, enter the IP address.
Serial:
Ethernet:
Revisit the Star JavaPOS folder and locate the sample receipt file named “StarReceiptTest.java”. Right click and click Open with Text Editor.
Search for the printer.open statement.
Paste the printers Logical Name into the “printer.open” section as shown below.
Scroll to the top of the StarReceiptTest.java file to the “Usage instructions – Linux” section.
Open terminal and change to the directory to the starjavapos_linux_Ver1.9.13 folder.
Refer back to the StarReceiptTest.java file and copy “javac –classpath jpos191-controls.jar:jcl.jar StarReceipt Test.java”.
Type “sudo” in Terminal and then paste in the command line and hit enter.
Enter the password if prompted.
Copy the second line “java –classpath .:starjavapos.jar:stario.jar:commandemulator.jar:jpos101- controls.jar:jcl.jar:xercesimpl.jar-apis.jar StarReceiptTest”
Type “sudo” in Terminal, paste in the command line and hit enter.
Terminal will confirm that the command was accepted, and a sample test receipt will print out.
Congratulations! You have successfully printed using the Star Micronics JavaPOS driver.