title: Java Headless Exception after setting -Djava.awt.headless=true
body: <p>I am using:</p>
  
  <p>Linux Debian 6,
  Java 1.6.29 and
  Tomcat 6</p>
  
  <p>I've seen many posts about it explaining that <code>java.awt</code> requires X11 libraries..etc., but they are not solving the problem.</p>
  
  <p>I set -Djava.awt.headless=true in my box and I worked around the first problem of the headless environment, now I am getting:</p>
  
  <pre><code>java.awt.HeadlessException
  java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)
  java.awt.Window.(Window.java:432)
  java.awt.Frame.(Frame.java:403)
  javax.swing.JFrame.(JFrame.java:202)
  org.jfree.ui.ApplicationFrame.(ApplicationFrame.java:65)
  ...
  </code></pre>
  
  <p>I know by doing this I just told java that there is no monitor (and in fact running a standalone java program to check if the environment is headless it does return <code>true</code>). So is it anything to do with the Linux environment like setting the DISPLAY env variable?</p>
  
  <p>I would appreciate your help,</p>
  
  <p>Thanks.</p>