The best solution in my opinion (and also perhaps the easiest to implement) is to run a special X server for JBoss to use. You can use Xvfb, the X Virtual Frame Buffer, which
you should already have on your system. Start it like this (do this in a startup script if you like
/usr/X11R6/bin/Xvfb -auth /dev/null :5 2>/dev/null &
Now you've got a second X server on display :5. Then just put something like
export DISPLAY=:5
into the script you use to startup JBoss, and Bob's your uncle!