title: Java - appletviewer in Command Prompt
body: <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:173)
          at java.awt.Window.&lt;init&gt;(Window.java:437)
          at java.awt.Frame.&lt;init&gt;(Frame.java:419)
          at java.awt.Frame.&lt;init&gt;(Frame.java:384)
          at sun.applet.AppletViewer.&lt;init&gt;(AppletViewer.java:159)
          at sun.applet.StdAppletViewerFactory.createAppletViewer(AppletViewer.java:100)
          at sun.applet.AppletViewer.parse(AppletViewer.java:1140)
          at sun.applet.AppletViewer.parse(AppletViewer.java:1074)
          at sun.applet.Main.run(Main.java:156)
          at sun.applet.Main.main(Main.java:98)
  </code></pre>
  
  <p>I am getting the above error on compiling the file - "<code>HelloWorldApplet.html</code>" in command prompt with the command - </p>
  
  <pre><code>appletviewer HelloWorldApplet.html
  </code></pre>