When I'm trying to run a Java GUI application from the command line, I get:
Exception in thread "main" 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,"
I keep getting this error whenever I try to run code with java.swing GUI components.
$DISPLAY is set to :0 and java --version gives me openjdk 19.0.1.
edit: I tried to run java Main with either wayland or xorg but I get the same error.