Skip to content

Linux Headless: Unable to start JavaFX service #1387

@tresf

Description

@tresf

QZ Tray 2.2.5 fails to print HTML content on a Headless Linux server

Steps:

  1. Install Ubuntu 24.04 Server
  2. Install cups-pdf and cups-bsd packages
  3. Install the PDF printer:
    sudo lpadmin -p PDF -v cups-pdf:/ -E
  4. Install QZ Tray curl qz.sh | bash
  5. Configure setSignaturePromise and setCertificatePromise to use DEMO keys
  6. Copy the demo cert to the Ubuntu Server /opt/qz-tray/override.crt
  7. Start QZ Tray on the Ubuntu Server
  8. Connect sample.html to the Ubuntu Server's IP address
    Image
  9. From the "Pixel" tab, click "Print HTML"
WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @c1a4620'
Exception in thread "Thread-88" java.lang.UnsupportedOperationException: Unable to open DISPLAY
	at com.sun.glass.ui.gtk.GtkApplication.lambda$new$6(GtkApplication.java:202)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at com.sun.glass.ui.gtk.GtkApplication.<init>(GtkApplication.java:200)
	at com.sun.glass.ui.gtk.GtkPlatformFactory.createApplication(GtkPlatformFactory.java:41)
	at com.sun.glass.ui.Application.run(Application.java:146)
	at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:290)
	at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:293)
	at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:163)
	at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:659)
	at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:679)
	at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:196)
	at java.base/java.lang.Thread.run(Unknown Source)
[ERROR] 2025-12-05T21:33:10,420 @ qz.utils.PrintingUtilities:221
	Failed to print
java.lang.UnsupportedOperationException: Unable to start JavaFX service
	at qz.printer.action.PrintHTML.parseData(PrintHTML.java:140) ~[qz-tray.jar:?]
	at qz.utils.PrintingUtilities.processPrintRequest(PrintingUtilities.java:210) ~[qz-tray.jar:?]
	at qz.ws.PrintSocketClient.processMessage(PrintSocketClient.java:328) ~[qz-tray.jar:?]
	at qz.ws.PrintSocketClient.lambda$onMessage$0(PrintSocketClient.java:174) ~[qz-tray.jar:?]
	at java.base/java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.io.IOException: JavaFX did not start
	at qz.printer.action.html.WebApp.initialize(WebApp.java:213) ~[qz-tray.jar:?]
	at qz.printer.action.PrintHTML.parseData(PrintHTML.java:71) ~[qz-tray.jar:?]
	... 4 more

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions