Can't connect to window server - not enough permissions thrown when building clover report.
Symptoms
Generation of Clover report ends with a following error:
clover.report:
[clover-report] Clover Version 3.1.6, built on June 19 2012 (build-867)
[clover-report] Loaded from: /home/alice/clover.jar
[clover-report] Clover: Developer License registered to Atlassian.
[clover-report] Loading coverage database from: '/home/alice/.clover/clover3_1_6.db'
[clover-report] Loading coverage database from: '/home/alice/.clover/clover3_1_6.db'
[clover-report] Loading historical coverage data from: '/home/alice/.cloverhistory'
[clover-report] Writing HTML report to '/home/alice/.clover/report'
BUILD FAILED
jar:file:/home/alice/clover.jar!/clover.xml:33: java.lang.InternalError: Can't connect to X11 window server using 'SOME_HOST_NAME' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
...
at clover.org.jfree.chart.JFreeChart.<clinit>(JFreeChart.java:254)
...
at com.cenqua.clover.reporters.CloverReporter.execute(CloverReporter.java:41)
Typical messages:
java.lang.InternalError: Can't connect to window server - not enough permissions
java.lang.InternalError: Can't connect to X11 window server using 'SOME_HOST_NAME' as the value of the DISPLAY variable
java.lang.InternalError: Can't connect to X11 window server using '' as the value of the DISPLAY variable
Cause
This error can occur if you are running the command remotely (via putty).
This error can also occur when DISPLAY variable is set, but it's empty or points to non-existing host.
This error can also occur when X11 server is not running on a machine.
Resolution
1) Set correct value of DISPLAY variable or
2) If you-re running Clover on a machine with no X11 server, then add -Djava.awt.headless=true to VM launch parameters, this tells AWT to use headless mode:
export ANT_OPTS=-Djava.awt.headless=true
Use "export ANT_OPTS=-D..." instead of "ant -D..."