Command Line


  • 2.2 | 2.1 | 2.0 | 1.9 ...


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

Environmental Variables

Variable Description Usage
_JAVA_OPTIONS Sets 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_OPTS Sets 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
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/ --bundleid

Installer Options

See deployment steps.

Command Line Usage

Since 2.1.3

   java -jar qz-tray.jar [options]

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

  --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 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 for FileIO operations
                                java -jar qz-tray.jar --file-remove /my/file/path

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

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

  jlink                       Download, compress and bundle a Java Runtime
                                java -jar qz-tray.jar jlink [--platform mac|windows|linux] [--arch x64|aarch64]
                                  [--gc hotspot|j9]

For help on a specific command:
  Usage: java -jar qz-tray.jar --help (command)
    --help install
    --help certgen

System Properties

QZ Tray will honor Java system properties via command-line override.

Property Description Example
trustedRootCert Overrides the internal licensing certificate by reading the path provided. java -DtrustedRootCert=custom_cert.pem -jar qz-tray.jar ...
Edit this page