How to setup JavaPOS with Star Printer on Ubuntu Linux

You are here:

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.

A screenshot of a cell phone

Description automatically generated

 

Enter the password if prompted.

A screenshot of a cell phone

Description automatically generated

 

Search for sunjava6.jdk in the Quick search field.

A screenshot of a cell phone

Description automatically generated

 

When the package appears, right-click on it and click on Mark for Installation.

A screenshot of a cell phone

Description automatically generated

 

Click the Mark button.

A screenshot of a cell phone

Description automatically generated

 

All other necessary packages will be selected automatically. Click Apply at the top.

A screenshot of a cell phone

Description automatically generated

 

Click the Apply button.

A screenshot of a cell phone

Description automatically generated

 

The files will download.

A screenshot of a cell phone

Description automatically generated

 

Agree to the license terms and click Forward.

A screenshot of a cell phone

Description automatically generated

 

Click the Close button.

A screenshot of a cell phone

Description automatically generated

 

Open the Synaptic Package Manager again and ensure there is a green box next to sun-java6-jdk.

A screenshot of a social media post

Description automatically generated

 

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.

A screenshot of a social media post

Description automatically generated

 

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.

A screenshot of a social media post

Description automatically generated

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:

A screenshot of a cell phone

Description automatically generated

 

Ethernet:

A picture containing holding

Description automatically generated

 

Revisit the Star JavaPOS folder and locate the sample receipt file named “StarReceiptTest.java”. Right click and click Open with Text Editor.

A screenshot of a cell phone

Description automatically generated

 

Search for the printer.open statement.

A screenshot of a cell phone

Description automatically generated

 

Paste the printers Logical Name into the “printer.open” section as shown below.

A screenshot of a cell phone

Description automatically generated

 

Scroll to the top of the StarReceiptTest.java file to the “Usage instructions – Linux” section.

A screenshot of a social media post

Description automatically generated

 

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”.

A screenshot of a cell phone

Description automatically generated

 

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”

A screenshot of a cell phone

Description automatically generated

 

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.

A screenshot of a social media post

Description automatically generated

 

Congratulations! You have successfully printed using the Star Micronics JavaPOS driver.

 

 

Was this article helpful?
How can we improve this article?
 


Table of Contents