我有一个用 install4j 安装的 Java 应用程序。在某些测试环境中,让它在无头环境中启动很有用。但是,目前这会引发:
java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)
at java.awt.Window.<init>(Window.java:431)
at java.awt.Frame.<init>(Frame.java:403)
at java.awt.Frame.<init>(Frame.java:368)
at com.install4j.runtime.splashscreen.JavaSplashScreen.<init>(Unknown Source)
at com.install4j.runtime.splashscreen.JavaSplashController.show(Unknown Source)
at com.install4j.runtime.launcher.SplashEngine.showSplashScreen(Unknown Source)
at com.install4j.runtime.launcher.Launcher.main(Unknown Source)
由于启动画面是程序中唯一需要显示的部分,因此如果可以使用命令行开关或至少程序本身中的一些代码禁用它会很棒(这似乎是一个不太可能的选项,因为这在我的代码运行之前抛出异常)。有这样的选择吗?