0

I'm trying to run my code but I keep getting this message every time I run it. In my college computer lab everything works fine, the images show up, but when I try to do it remotely from my Macbook pro, it doesn't let me. I always get this message.

Exception in thread "main" java.awt.HeadlessException: 
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.<init>(Window.java:548)
        at java.desktop/java.awt.Frame.<init>(Frame.java:423)
        at java.desktop/java.awt.Frame.<init>(Frame.java:388)
        at java.desktop/javax.swing.JFrame.<init>(JFrame.java:180)
        at GUI.Window.<init>(Window.java:154)
        at TitleScreen.<init>(TitleScreen.java:35)
        at Minesweeper.main(Minesweeper.java:48)
Suraj Rao
  • 28,850
  • 10
  • 94
  • 99
torr24
  • 1
  • 1
    Does this answer your question? ["No X11 DISPLAY variable" - what does it mean?](https://stackoverflow.com/questions/662421/no-x11-display-variable-what-does-it-mean) Also, how are you connected remotely, via SSH? Or via a graphical interface? If you are attempting to run the code on a server without a screen then understandingly it will produce this error. – sorifiend May 17 '22 at 04:58

0 Answers0