title: Throws exception in online complier but works fine in IDE
body: <p>While performing this simple Java GUI code in Eclipse IDE it works fine</p>
  <pre><code>import javax.swing.*;
  
  public class SimpleGui {
  public static void main(String[] args) {
  JFrame frame = new JFrame();
  JButton button = new JButton(&quot;Click me!&quot;);
  
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.getContentPane().add(button);
  frame.setSize(200, 200);
  frame.setVisible(true);
  }
  }
  </code></pre>
  <p>and produces a result like this image.</p>
  <p><a href="https://i.stack.imgur.com/pjoxe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pjoxe.png" alt="Output" /></a></p>
  <p>But while trying out the same program in the online GDB compiler it throws the following error. I ensured that the class name and file name are the same (<code>Main.java</code>) in the online compiler.</p>
  <pre><code>Exception in thread &quot;main&quot; java.awt.AWTError: Can't connect to X11 window server using ':1' as the value of the DISPLAY variable.
      at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
      at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65)
      at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:115)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.awt.X11GraphicsEnvironment.&lt;clinit&gt;(X11GraphicsEnvironment.java:74)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:264)
      at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:103)
      at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82)
      at java.awt.Window.initGC(Window.java:475)
      at java.awt.Window.init(Window.java:495)
      at java.awt.Window.&lt;init&gt;(Window.java:537)
      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:189)
      at Main.main(Main.java:13)
  </code></pre>
  <p>What is the reason behind this error and how could it be resolved?</p>