diff --git a/src/main/java/net/sourceforge/plantuml/servlet/DiagramResponse.java b/src/main/java/net/sourceforge/plantuml/servlet/DiagramResponse.java index 8f74d105..7150dfcc 100644 --- a/src/main/java/net/sourceforge/plantuml/servlet/DiagramResponse.java +++ b/src/main/java/net/sourceforge/plantuml/servlet/DiagramResponse.java @@ -121,6 +121,10 @@ public static void init() { return; } initialized = true; + // set headless mode manually since otherwise Windows 11 seems to have some issues with it + // see Issue#311 :: https://github.com/plantuml/plantuml-server/issues/311 + // NOTE: This can only be set before any awt/X11/... related stuff is loaded + System.setProperty("java.awt.headless", System.getProperty("java.awt.headless", "true")); // set security profile to INTERNET by default // NOTE: this property is cached inside PlantUML and cannot be changed after the first call of PlantUML System.setProperty("PLANTUML_SECURITY_PROFILE", SecurityProfile.INTERNET.toString());