hexadeciman / Snake

A simple snake game in java - Well documented
MIT License
345 stars 320 forks source link

Doesn't work on Ubuttu 22.10 #24

Closed yoseidonn closed 1 week ago

yoseidonn commented 1 year ago

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 1 year ago

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

TMTRTLP commented 1 year ago

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.