I had the same problem but found an easy solution elsewhere: use
java -Djava.awt.headless=true ...
to start your software. This will work in Java 1.4 and higher (at least in Sun's own Java, I don't know about other JVM's).
This parameter will make it impossible to actually display anything on a screen, but all the awt stuff which does not really need a screen will work.