Getting a HeadlessException: No X11 DISPLAY variable was set

Ahsan picture Ahsan · Mar 7, 2011 · Viewed 141.1k times · Source
Exception in thread "main" java.awt.HeadlessException:
    No X11 DISPLAY variable was set, but this program performed an operation which requires it.
        at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)
        at java.awt.Window.<init>(Window.java:432)
        at java.awt.Frame.<init>(Frame.java:403)
        at javax.swing.JFrame.<init>(JFrame.java:202)
        at DrawGUI.<init>(DrawGUI.java:15)
        at ShapeCreator.<init>(ShapeCreator.java:31)
        at ShapeCreator.main(ShapeCreator.java:138)

What does this error message mean? And how can I solve it?

Answer

adarshr picture adarshr · Mar 7, 2011

I assume you're trying to tunnel into some unix box.

Make sure X11 forwarding is enabled in your PuTTY settings.

enter image description here