No X11 DISPLAY variable was set

I set up a new laptop and I’m having an issue with Java wanting to use X11 but I don’t have whatever package I need to make the display work. Can anyone point me to how to fix this?

Sun Jan 18 11:31:52 EST 2026: loading core GUI class....
Sun Jan 18 11:31:52 EST 2026: YAAC raising splash screen....
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:119)
at java.base/java.lang.reflect.Method.invoke(Method.java:565)
at org.ka2ddo.yaac.YAAC.main(YAAC.java:791)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:565)
at org.ka2ddo.yaac.bootstrap.YAACBootstrap.main(YAACBootstrap.java:271)
Caused by: java.awt.HeadlessException:
No X11 DISPLAY variable was set,
or no headful library support was found,
but this program performed an operation which requires it.

Can you verify which java you have installed?
dnf list --installed java*
if you just have the headless version installed can you install the full version?

Which desktop software did you install?
With gnome and kde plasma DISPLAY is setup by default.
You check that in a terminal by doing echo $DISPLAY.

$ dnf list --installed java*
Installed packages
java-25-openjdk-crypto-adapter.x86_64 1:25.0.1.0.8-3.fc43 updates
java-25-openjdk-headless.x86_64 1:25.0.1.0.8-3.fc43 updates
java-srpm-macros.noarch 1-7.fc43 fedora
javapackages-filesystem.noarch 6.4.1-4.fc43 koji-override-0
javapackages-tools.noarch 6.4.1-4.fc43 fedora
javascriptcoregtk4.1.x86_64 2.50.4-1.fc43 updates
javascriptcoregtk6.0.x86_64 2.50.4-1.fc43 updates

I’m running Cinnamon (GNOME?).

$ echo $DISPLAY
:0

I just installed java-25-openjdk and it seems to work. Odd, I could have sworn that I had that installed. :thinking:

I’ll continue testing and will report back, but I think it’s working now. Thank you!

1 Like

Okay, DISPLAY is set for tour login session.
Are you trying to run the java as a systemd service?

No, I’m just executing the .jar from the command line.