Helpful Hint for Headless Unix Servers

While investigating Java charting solutions for use in JSP applications, I was introduced to the fearsome “headless server problem.” For the uninitiated, this is the problem where the Java AWT expects a GUI to be installed on the server so it can use the display driver to generate graphics. When you try to run something on a headless server that requires the AWT, you’ll get this error:

java.lang.InternalError: Can't connect to X11 window server using ':0.0'

The solution is simple when you’re using JDK 1.4, just add the following line before you start using any AWTclasses:


This simple line sets the AWT to run in headless mode, foregoing the system display driver and more importantly, making your code work. Nice of Sun to get around to this feature!

Understanding JavaScript Promises E-book Cover

Demystify JavaScript promises with the e-book that explains not just concepts, but also real-world uses of promises.

Download the Free E-book!

The community edition of Understanding JavaScript Promises is a free download that arrives in minutes.