When generating some report types on my UNIX server with no XServer, I get an exception "Can't connect to X11 server" or similar.
Q: When generating some report types on my UNIX server with no XServer, I get an exception "Can't connect to X11 server" or similar.
This is a limitation of the Java implementation on Unix.Prior to JDK 1.4, the java graphics toolkit (AWT) requires the presence of an XServer, even in the case where no "on-screen" graphics are rendered.
With JDK1.4, you can set the System property java.awt.headless=true
to avoid this problem. When running Ant, this is most easily achieved by using the ANT_OPTS environment variable:
export ANT_OPTS=-Djava.awt.headless=true
When running your code outside Ant, you may also need to set this system property.
With earlier JDKs, you need to use a virtual X Server. See http://java.sun.com/products/java-media/2D/forDevelopers/java2dfaq.html#xvfb.