hexadeciman/Snake

Doesn't work on Ubuttu 22.10

Closed this issue · 2 comments

I don't actually know if it works on other versions of distros but it gives an error says: No X11 DISPLAY variable was set. I'm not familiar with java but i think it can not find the correct stuff for the gui. You may wanna check it if it's important for you. Good job btw.

sanj0 commented

This is a pure Java project; the error you're getting is out of scope and has to do with your environment variables. Try setting your DISPLAY env var to :0.0 for main display like so:

export DISPLAY=:0.0

and/or add that to your *rc script anyway.
See also https://stackoverflow.com/questions/662421/no-x11-display-variable-what-does-it-mean

It also might be a good idea to check to see if you have a headless version of Java installed. I was also having issues with this even after setting the display variable. It turns out it was because I had openjdk-21-jdk-headless installed instead of openjdk-21-jdk. After installing the normal JDK everything started working.