Performance graphs on Jenkins causing "Could not initialize class org.jfree.chart.JFreeChart" exceptions
Angels Answer is correct, you have to add -Djava.awt.headless=true
.
However, in my case it wasn't enough: I was running Jenkins on openjdk-8-jre-headless
(Debian), which doesn't contain some libraries that JFreeChart requires.
Solution: use openjdk-jre-8
instead of openjdk-jre-8-headless
.
Just an additional note to the people arriving from search engines.
Solved! Somebody helped me to solve it here : https://groups.google.com/forum/#!topic/jenkinsci-users/o_Dr7Tn0i3U
It's not a bug in Jenkins but a miss-configuration. The solution is just adding
-Djava.awt.headless=true
to Jenkin's runtime.
I'm running Jenkins as a webapp on my Tomcat, then I just added this line to my /opt/tomcat/bin/catalina.sh :
CATALINA_OPTS=-Djava.awt.headless=true
I wanted you to share this solution. Cheers from Barcelona.
/ Angel