I am getting this error in the Linux environment while displaying 3D pie charts on the web browser. It works perfectly fine in the windows environment.
java.lang.NoClassDefFoundError: Could not initialize class org.jfree.chart.JFreeChart at org.jfree.chart.ChartFactory.createPieChart3D(ChartFactory.java:763)
I have set the system property System.setProperty("java.awt.headless", "true"); in my java code. On checking the property, it has been set to true successfully. But still i am getting the same error.
I suspect your Linux server is running headless. See Using Headless Mode in the Java SE Platform, as well as this related forum thread.
来源:https://stackoverflow.com/questions/7400395/jfreechart-error-in-linux-unix-environment