Are you sure that java.awt.headless property is getting into your environment correctly? Is your applet intended to be run in a headless environment for some reason? Here's a quick sample application that demonstrates what that flag does:
import java.awt.GraphicsEnvironment;
public class GETest {
public static void main(String[] args) {
GraphicsEnvironment ge =
GraphicsEnvironment.getLocalGraphicsEnvironment();
System.out.println("class: " + ge.getClass());
System.out.println("isHeadless:" + ge.isHeadless());
}
}
When I run this in Linux without the flag:
$ java GETest
class: class sun.awt.X11GraphicsEnvironment
isHeadless:false
When I run this in Linux with the flag:
$ java -Djava.awt.headless=true GETest
class: class sun.java2d.HeadlessGraphicsEnvironment
isHeadless:true
Further, if I unset DISPLAY, and run without the flag, I get the exception:
$ unset DISPLAY
$ java -Djava.awt.headless GETest
Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.access$100(X11GraphicsEnvironment.java:52)
...
If I then set the flag, I get the same output as I do in the isHeadless:true example above.
You should describe your environment more fully, that would help in diagnosing your problem.