0

Any time I'd like to run a file that opens a window, I get the following error:

No X11 DISPLAY variable was set, but this program performed an operation which requires it. at java.desktop/java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:208) at java.desktop/java.awt.Window.(Window.java:548) at java.desktop/java.awt.Frame.(Frame.java:423) at java.desktop/java.awt.Frame.(Frame.java:388) at java.desktop/javax.swing.JFrame.(JFrame.java:180) at hw04.GameOfLife.(GameOfLife.java:23) at hw04.GameOfLife.main(GameOfLife.java:147)

EDIT: I ran sudo apt-get install libx11-dev and it says I already have it installed... I don't know where to go from here

yonik
  • 21
  • 1
  • 2
  • 3
  • setenv DISPLAY=":0.0" - is the X server actually running? – John3136 Oct 12 '21 at 22:36
  • Nothing happens when I enter DISPLAY=":0.0" into terminal – yonik Oct 12 '21 at 22:37
  • If literally nothing happens then you haven't given us the whole story. The message should go from "No X11 DISPLAY was set" to something like "Could not open Display". Are you trying to start the program from the same shell you just set the DISPLAY in ? Is X11 running ? – John3136 Oct 12 '21 at 23:06
  • I tried running my program. I get that error message above, I ran DISPLAY=":0.0" Then, when trying to run my program again, I get the same error (I ran it in the same shell) – yonik Oct 12 '21 at 23:11
  • Does any of this help: https://stackoverflow.com/questions/662421/no-x11-display-variable-what-does-it-mean – John3136 Oct 12 '21 at 23:17

0 Answers0