title: java.awt.HeadlessException: No X11 DISPLAY variable was set error during maven build
body: <p><strong>Code</strong></p>
  
  <pre><code>public class Abc extends Applet{
  
    public Abc(){
     super();
     //some codes
    }
  </code></pre>
  
  <p><strong>Junit Test</strong></p>
  
  <pre><code>public class AbcTest extends TestCase{
  
   @Before
  
   public void setup() throws exception{
  
    Abc abc = new Abc()
   }
  
   @Test
  // Some test methods.
  
  }
  </code></pre>
  
  <p><strong>Error</strong> </p>
  
  <pre><code>java.awt.HeadlessException: No X11 DISPLAY variable was set, but this program performed an operation which requires it.
  at java.applet.Applet.&lt;init&gt;(Applet.java:75)
  </code></pre>
  
  <p>Build is successful in Windows. 
  Is it a linux problem ?</p>
  
  <p>How can I remove this error without removing the complete test class.</p>
  
  <p>Thanks in advance</p>
  
  <p>Abbin</p>