Skip to content

Command Line

Tres Finocchiaro edited this page Sep 22, 2020 · 34 revisions

Compatibility

  • ✅ 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

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

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

USAGE
   java -jar qz-tray.jar [options]

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

OPTION
  --honorautostart, -A        Read and honor any autostart preferences before launching.
  --headless                  Force startup "headless" without graphical interface or interactive components.

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

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 ...
Clone this wiki locally