Installation AutoLab4j
This page covers deploying AutoLab4j on a server or PC connected to the production network.
Requirements
- Network access to the Modbus I/O device on each production line (TCP port 502 by default)
- Network access to each Zebra printer (TCP port 9100)
- Network access to the Commander4j server (to receive CSV dataset files)
- Windows, Linux, or macOS
- Java 21 (JRE or JDK) — required only when running from the distribution archive; the native install package bundles its own Java runtime
Installation
Native install packages for Windows, macOS, and Linux are available from the Downloads page and are the preferred installation method. The installer creates the application directory, registers it with the operating system, and handles the Java runtime dependency automatically.
Alternatively, a distribution archive can be downloaded from the Downloads page and extracted to a suitable directory, for example:
C:\Commander4j\AutoLab4j\ (Windows) /opt/commander4j/autolab4j/ (Linux)
The extracted directory contains:
AutoLab.jar lib/ xml/ labels/ logs/ interface/ running/
Configuration Before First Run
Before starting AutoLab4j, complete the following configuration steps.
1. Production Lines
Edit xml/config/config.xml and define each production line. For each line you need:
- The Modbus device IP address and port
- The coil address that signals a pallet complete event
- The coil address for semi-pallet detection
- The printer name (must match the name used in Commander4j)
See AutoLab4j Configuration for the full XML structure.
2. SSCC Sequence Files
Create one SSCC sequence file per printer in xml/sscc/. The filename must match the printer name configured in config.xml. For example, for a printer named PRINTER 1:
xml/sscc/PRINTER 1.xml
The file must contain the SSCC prefix, starting sequence number, warning limit, and upper limit. Your GS1 member organisation will provide the prefix. Example:
<?xml version="1.0" encoding="UTF-8"?> <sscc> <prefix>384133182</prefix> <sequence>00000001</sequence> <checkDigit>0</checkDigit> <upperlimit>00009999</upperlimit> <warninglimit>00009000</warninglimit> </sscc>
3. Label Templates
Copy the ZPL label template files into the labels/ directory. The filename for each template is specified in the CSV dataset file in the REPORT_FILENAME field. See Zebra ZPL Label for information on ZPL label authoring.
4. Dataset Directory
Ensure the directory configured as dataSet path in config.xml is accessible. This is where Commander4j writes the CSV files when an operator assigns a process order to a labeller. The directory can be a local path or a network share.
5. Output Directory
Ensure the directory configured as output path in config.xml exists and is writable. AutoLab4j writes Production Declaration XML files here after each pallet is printed.
6. Email Notifications (Optional)
If you want email alerts for SSCC warnings and service start/stop events, configure xml/config/email.xml with your SMTP server details and distribution lists.
Starting AutoLab4j
Windows — Native Package
The native install package creates AutoLab4j_Startup.exe in the installation directory. Double-click this launcher, or create a shortcut to it, to start AutoLab4j. It enforces single-instance operation — a second launch will signal the running instance to shut down before the new one starts.
AutoLab4j is a GUI application and does not include a built-in Windows service launcher. To run it automatically at boot without an interactive session, use a service wrapper such as WinSW configured to launch AutoLab4j_Startup.exe.
Windows — Distribution Archive
If running from the extracted archive rather than the native package:
java -jar AutoLab.jar
Linux / macOS
java -jar AutoLab.jar
Use systemd, launchd, or nohup for production deployment as a background process.
When running, AutoLab4j appears in the system tray with one icon per production line. The System Log window shows startup progress.
Exclusive Runtime
AutoLab4j uses a TCP port (default: 8000) as an exclusive runtime lock. Only one instance can run at a time. If you start a second instance, it sends a shutdown signal to the running instance and waits for it to stop before starting. The watchdog port can be changed in config.xml.
Verifying the Installation
After starting AutoLab4j:
- Check the system tray — there should be one icon per enabled production line.
- Open the System Log window (right-click the system tray icon).
- Verify that each production line shows a Modbus connection attempt in its log window.
- Place a test CSV file in the dataset directory and trigger the Modbus coil to confirm end-to-end operation.
Log Files
All activity is written to logs/AutoLab.log. Log files rotate at 10 MB and are retained for 14 days. Review this file if any production line fails to connect or if labels are not printing.
See also: AutoLab4j Configuration, Overview AutoLab4j, AutoLab4j Operation