Why is Java working in Fedora 39 and not working in Fedora 40?

I have 2 installations of Fedora — 39 as main and 40 as testing.

In Fedora 39 Java works (from command line java -jar).

In Fedora 40 with the same JAR Java fails with the message: “no x11 display variable was set, or no headful library support was found”. It says there is no DISPLAY variable, but id does exist and set to “:0” by system.

Check : Cannot run Java jar file in Wayland-only Fedora 40 - #4 by jakfrost

In a few words, check if the java installed is the headless one.

2 Likes

Thank you very much! Installing java-21-openjdk package solved the issue.

1 Like