Documentation

Command Line

Compatibility

  • ✅ 2.2 | ⚠️ 2.1 | ⛔ 2.0 | ⛔ 1.9 …

Contents

Advanced command line usage and environmental variable usage examples. For compiling options, see compiling. For installer options, see deployment.

Environmental Variables

VariableDescriptionUsage
_JAVA_OPTIONSSets Java command line options for all Java VMs to be picked up.
⚠️ WARNING: Use with caution, impacts all Java instances and applications.
export _JAVA_OPTIONS=-Xmx4096m
QZ_OPTSSets Java command line options for only QZ Tray to pick up.
(will NOT impact other Java applications)
Since 2.1.3
export QZ_OPTS=-Xmx4096m
or
export QZ_OPTS=-DtrustedRootCert=custom_cert.pem

💡 Environmental variables will take effect after QZ Tray is restarted.

Windows Environment Variables

Windows environmental variables are often set through Advanced System Settings, Advanced, Environment Variables. Alternatively,through the set|setx command.

setx QZ_OPTS "-Xmx4096m"

… and to revert:

setx QZ_OPTS ""

macOS Environment Variables

macOS environmental variables do not persist; set via defaults write instead:

defaults write io.qz.qz-tray QZ_OPTS -string "-Xmx4096m"`

… and to revert:

defaults delete io.qz.qz-tray QZ_OPTS

💡 For custom branded (white-label) customers, this command will change to defaults write <BUNDLE_ID>.
… where <BUNDLE_ID> is the value returned from java -jar /Applications/MyApp.app/my-app.jar --bundleid

Installer Options

See deployment steps.

Command Line Usage

Since 2.2.0

# Windows
"C:\Program Files\QZ Tray\qz-tray-console.exe" [options]

# Mac
"/Applications/QZ Tray.app/Contents/MacOS/QZ Tray" [options]

# Linux
"/opt/qz-tray/qz-tray" [options]
Usage: java -jar qz-tray.jar (command)

INFORMATION
  --help, -h, /?                   Display help information and exit.
  --version, -v                    Display version information and exit.
  --bundleid, -i                   Display Apple bundle identifier and exit.
  --libinfo, -l                    Display detailed library version information and exit.

ACTION
  --allow, --whitelist, -a         Add the specified certificate to allowed.dat.
                                     java -jar qz-tray.jar --allow cert.pem
  --block, --blacklist, -b         Add the specified certificate to blocked.dat.
                                     java -jar qz-tray.jar --block cert.pem
  --file-allow                     Add the specified file.allow entry to qz-tray.properties for FileIO operations, sandboxed to a specified certificate if provided
                                     java -jar qz-tray.jar --file-allow /my/file/path [--sandbox "Company Name"]
  --file-remove                    Removes the specified file.allow entry from qz-tray.properties for FileIO operations
                                     java -jar qz-tray.jar --file-remove /my/file/path

OPTION
  --honorautostart, -A             Read and honor any autostart preferences before launching. [true]
  --steal, qz:steal                Ask other running instance to stop so that this instance can take precedence. [false]
  --headless                       Force startup "headless" without graphical interface or interactive components. [false]

INSTALLER
  preinstall                       Perform critical pre-installation steps: Stop instances, all other special considerations.
  install                          Copy to the specified destination and preforms platform-specific registration.
                                     java -jar qz-tray.jar install --dest /my/install/location [--silent]
  certgen                          Performs certificate generation and registration for proper HTTPS support.
                                     java -jar qz-tray.jar certgen [--key key.pem --cert cert.pem] [--pfx cert.pfx --pass 12345] [--host "list;of;hosts"]
  uninstall                        Perform all uninstall tasks: Stop instances, delete files, unregister settings.
  spawn                            Spawn an instance of the specified program as the logged-in user, avoiding starting as the root user if possible.
                                     java -jar qz-tray.jar spawn [program params ...]

BUILD
  jlink                            Download, compress and bundle a Java Runtime
                                     java -jar qz-tray.jar jlink [--platform mac|windows|linux] [--arch x64|aarch64] [--vendor bellsoft|eclipse|...] [--version ...] [--gc hotspot|openj9] [--gcversion ...]
  provision                        Provision/bundle addition settings or resources into this installer
                                     java -jar qz-tray.jar provision --json file.json [--target-os windows --target-arch x86_64]
For help on a specific command:
  Usage: java -jar qz-tray.jar --help (command)
    --help --file-allow
    --help install
    --help certgen

System Properties

QZ Tray will honor Java system properties via:

  • Command-line override: -Doption=value
  • Environmental variables: QZ_OPTS
  • Properties file: qz-tray.properties (Advanced —> Diagnostic —> Browse App Folder)
  • Preferences file: prefs.properties* (Advanced —> Diagnostic —> Browse User Folder)
    *for properties which support user-scoped overrides

e.g.

# custom websocket port example
websocket.secure.ports=9191,9292
websocket.insecure.ports=9192,9293
PropertyDescriptionExample
trustedRootCertOverrides the internal licensing certificate by reading the path provided.java -DtrustedRootCert=custom_cert.pem -jar qz-tray.jar ...
tray.notificationsShow verbose connect/disconnect notifications in the tray area.java -Dtray.notifications=true -jar qz-tray.jar ...
tray.headlessForce QZ Tray into headless modejava -Dtray.headless=true -jar qz-tray.jar ...
tray.monocleEnable/disable monocle JavaFX rendering enginejava -Dtray.monocle=false -jar qz-tray.jar ...
tray.strictmodeUse strict certificate modejava -Dtray.strictmode=true -jar qz-tray.jar ...
tray.idle.printersWhen idle, fetch printers in the backgroundjava -Dtray.idle.printers=false -jar qz-tray.jar ...
tray.idle.javafxWhen idle, startup Java FX in the backgroundjava -Dtray.javafx=true -jar qz-tray.jar ...
security.file.enabledEnable/disable all File Communications features [true]java -Dsecurity.file.enabled=false -jar qz-tray.jar ...
security.file.strictEnable/disable signing requirements for File Communications features [true]java -Dsecurity.file.strict=false -jar qz-tray.jar ...
security.substitutions.enableEnable/disable client-side JSON data substitutions via “substitutions.json” file [true] (Since 2.2.4)java -Dsecurity.substitutions.enable=false -jar qz-tray.jar ...
security.substitutions.strictEnable/disable restrictions for materially changing JSON substitutions such as “copies”:, “data”: { “data”: … } blobs [true] (Since 2.2.4)java -Dsecurity.substitutions.strict=false -jar qz-tray.jar ...
security.data.protocolsURL protocols allowed for print, serial, hid, etc [http,https] (Since 2.2.4)java -Dsecurity.data.protocols="ftp" -jar qz-tray.jar ...
security.print.tofileEnable/disable printing directly to file paths [false] (Since 2.2.4)java -Dsecurity.print.tofile=true -jar qz-tray.jar ...
security.print.tohostEnable/disable printing directly to an HTTP host [true] (Since 2.3.0)java -Dsecurity.print.tohost=false -jar qz-tray.jar ...
security.print.demoassetsEnable/disable file exceptions for ‘demo/assets’ [true] (Since 2.3.0)java -Dsecurity.print.demoassets=false -jar qz-tray.jar ...
security.wss.snistrictEnables strict http/websocket SNI checks [false] (Since 2.2.4)java -Dsecurity.wss.snistrict=true -jar qz-tray.jar ...
security.wss.httpsonlyDisables insecure http/websocket ports (e.g. ‘8182’) [false] (Since 2.2.4)java -Dsecurity.wss.httpsonly=true -jar qz-tray.jar ...
security.wss.hostInfluences which physical adapter to bind to by setting the host parameter for http/websocket listening [0.0.0.0] (Since 2.2.4)java -Dsecurity.wss.host="192.168.1.2" -jar qz-tray.jar ...
security.wss.alloworiginOverride Access-Control-Allow-Origin: * HTTP response header for fine-grained control of incoming HTTP connections. Multiple values may be separated by commas (2.3.0+) but will only apply to WebSocket connections. [*] (Since 2.2.5)java -Dsecurity.wss.alloworigin=https://demo.qz.io -jar qz-tray.jar ...
tray.file.enabledEnable/disable File IOjava -Dtray.file.enabled=false -jar qz-tray.jar ...
tray.file.strictEnable/disable valid signatures for File IOjava -Dtray.file.strict=false -jar qz-tray.jar ...
printer.details.debugDebug printer details to the logs as they’re crawled. Helpful for debugging driver-related hard-crashes (Since 2.3.0)java -Dprinter.details.debug=true -jar qz-tray.jar ...
printer.status.jobdataReturns binary job data with printer job events (Since 2.2.2)java -Dprinter.status.jobdata=true -jar qz-tray.jar ...
websocket.secure.portsComma separated list of secure websocket (wss://) ports to use [8181,8282,8383,8484] (Since 2.2.4)java -Dwebsocket.secure.ports=9191,9292 -jar qz-tray.jar ...
websocket.insecure.portsComma separated list of insecure websocket (ws://) ports to use [8182,8283,8384,8485] (Since 2.2.4)java -Dwebsocket.insecure.ports=9192,9293 -jar qz-tray.jar ...
log.disableDisables logging. (Since 2.2.3)java -Dlog.disable=true -jar qz-tray.jar ...
log.sizeModify the log file size before rotating to a new file (Since 2.2.3)java -Dlog.size=2097152 -jar qz-tray.jar ...
log.rotateModifies the number of rotated log files. (Since 2.2.3)java -Dlog.rotate=9 -jar qz-tray.jar ...
Edit this page