Skip to content

Conversation

@fynngodau
Copy link
Contributor

Intended Change

A fellow student was using KeY on a system where headless java was installed, and was thus confused why the proram would not launch normally. It seems that java.awt.GraphicsEnvironment.isHeadless() also returns false if libawt is not available, i.e. a headless version of Java is installed. In this case it helped us to debug to set the java runtime flag -Djava.awt.headless=false, thus exposing the actual problem (in the form of a crash because libawt is not installed).

For this reason, we found it would be nice to provide a bit more details about possible causes in case the program terminates with error when launched normally in headless mode.

Type of pull request

  • There are changes to the (Java) code
  • Other: error message improvement

Ensuring quality

  • I made sure that introduced/changed code is well documented (javadoc and inline comments).

Additional information and contact(s)

The contributions within this pull request are licensed under GPLv2 (only) for inclusion in KeY.

@WolframPfeifer WolframPfeifer added Command Line Interface Error Reporting Missing file/position info for parse errors, uncaught errors, wrong/unclear messages, ... labels Nov 13, 2025
@codecov
Copy link

codecov bot commented Nov 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.99%. Comparing base (28d4dec) to head (2aa39bb).
⚠️ Report is 30 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3685      +/-   ##
============================================
+ Coverage     47.06%   47.99%   +0.92%     
- Complexity    15804    16046     +242     
============================================
  Files          1675     1683       +8     
  Lines         96331    96044     -287     
  Branches      15431    15387      -44     
============================================
+ Hits          45339    46093     +754     
+ Misses        45823    44681    -1142     
- Partials       5169     5270     +101     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Provide advise to users who are using a headless version of java on
accident.
@fynngodau fynngodau force-pushed the headless-error-message branch from bf46669 to 2aa39bb Compare November 13, 2025 12:35
Copy link
Member

@WolframPfeifer WolframPfeifer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @fynngodau for improving the error messages of KeY!

We have quite strict rules about code formatting and enforce them with spotless. So if the formatting check fails, you can run ./gradlew spotlessJavaApply and then commit the changes. Thanks!

@WolframPfeifer WolframPfeifer added this pull request to the merge queue Nov 13, 2025
Merged via the queue into KeYProject:main with commit 0922260 Nov 13, 2025
37 checks passed
@fynngodau fynngodau deleted the headless-error-message branch November 13, 2025 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Command Line Interface Error Reporting Missing file/position info for parse errors, uncaught errors, wrong/unclear messages, ...

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants