Skip to content

Commit bf46669

Browse files
committed
Improve error message in headless mode
Provide advise to users who are using a headless version of java on accident.
1 parent 2a56855 commit bf46669

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

key.ui/src/main/java/de/uka/ilkd/key/gui/MainWindow.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,11 @@ public static MainWindow getInstance() {
393393

394394
public static MainWindow getInstance(boolean ensureIsVisible) {
395395
if (GraphicsEnvironment.isHeadless()) {
396+
LOGGER.error("Error: KeY started in graphical mode, but no graphical environment present or supported.");
396397
LOGGER.error(
397-
"Error: KeY started in graphical mode, " + "but no graphical environment present.");
398-
LOGGER.error("Please use the --auto option to start KeY in batch mode.");
398+
"If this is unexpected, ensure that you are not using a headless version of Java " +
399+
"(or force windowed mode with java parameter -Djava.awt.headless=false).");
400+
LOGGER.error("Otherwise, please use the --auto option to start KeY in batch mode.");
399401
LOGGER.error("Use the --help option for more command line options.");
400402
System.exit(-1);
401403
}

0 commit comments

Comments
 (0)