title: Getting "No X11 DISPLAY variable was set" while trying to run jar file
body: <p>I'm trying to run a jar file through Putty, which is uploaded via Amazon Web Server. I've tried to change the compiler compliance level from 1.8 to 1.7. I get the error: </p>
  
  <pre><code>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:207)
          at java.awt.Window.&lt;init&gt;(Window.java:535)
          at java.awt.Frame.&lt;init&gt;(Frame.java:420)
          at java.awt.Frame.&lt;init&gt;(Frame.java:385)
          at javax.swing.JFrame.&lt;init&gt;(JFrame.java:174)
          at Smiley.&lt;init&gt;(Smiley.java:10)
          at Main.main(Main.java:5)
  </code></pre>
  
  <p><a href="http://i.stack.imgur.com/xW6e9.png" rel="nofollow">I've enabled X11 forwarding in Putty</a></p>
  
  <p>The jar file works fine, when I run it from my desktop.</p>