title: How to run Java Swing application on raspberry pi
body: <p>I am trying to run Java swing application on raspberry pi (Model B revision 2) using Putty console. however when I run the command </p>
  
  <pre><code>java -jar myjar.jar
  </code></pre>
  
  <p>it throws exception:</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:536)
      at java.awt.Frame.&lt;init&gt;(Frame.java:420)
      at javax.swing.JFrame.&lt;init&gt;(JFrame.java:225)
      ...............
  </code></pre>
  
  <p>I used to set display level as</p>
  
  <pre><code>export DISPLAY=:0.0 
  </code></pre>
  
  <p>however it did not work. Readed all related SO posts however did not came to solution. please help me.</p>