Ok, so just in case anyone out there has this problem, there is a super easy fix that does involve updating libs or installing X11 etc.
So the problem is using any lib that access’s java.awt.*, running on a headless unix box (linux in my case), you get the following error: “java.lang.InternalError: Can’t connect to X11 window server using ‘:0.0′ as the value of the DISPLAY variable.” Subsequent reloads of the page result in exception “java.lang.NoClassDefFoundError”.
To fix this, all you have to do is add the following command to your httpd startup script:
-Djava.awt.headless=true
A lot of the sites I came across suggested annoying work-arounds (lib updates, installations), but this fixes the problem at the root.





March 14th, 2003 at 11:39 AM
Does it work for any VM? I mean, is it a standard Unix system property? or only on the Sun VM? I guess the ones most people would care about are the Sun and IBM JVMs, since those are the most commonly deployed JVMs for servlet development.