From: Niki Roo Date: Fri, 25 Mar 2016 14:08:35 +0000 (+0100) Subject: Force headless mode if "--tui" is passed X-Git-Tag: v1.0~9 X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=f578f3af81728d5f2590bc69ad125ef143d9d8f6;p=jvcard.git Force headless mode if "--tui" is passed (so we can generate image even if we have a DISPLAY env var and no X11) --- diff --git a/src/be/nikiroo/jvcard/launcher/Main.java b/src/be/nikiroo/jvcard/launcher/Main.java index 5fea28d..178dff1 100644 --- a/src/be/nikiroo/jvcard/launcher/Main.java +++ b/src/be/nikiroo/jvcard/launcher/Main.java @@ -167,6 +167,12 @@ public class Main { files.addAll(open(arg)); } } + + // Force headless mode if we run in forced-text mode + if (textMode != null && textMode) { + // same as -Djava.awt.headless=true + System.setProperty("java.awt.headless", "true"); + } if (unicode) { utf8();