Check for headless usage before attempting to use swing for errors.

Dump the error to stderr if there is no X-server running