Custom Search

Thursday, October 2, 2008

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

No comments: