问题
I am using JFreeChart in a Java swing application. I did specify where the libraries are in my builder.xml file:
<zipgroupfileset dir="../lib" includes="jfreechart-0.9.21.jar" />
<zipgroupfileset dir="../lib" includes="jcommon-1.0.8.jar" />
I imported those libraries; Eclipse doesn't show any compilation error. But I am getting this when I run the code:
java.lang.NoSuchMethodError: org.jfree.data.xy.XYSeries.<init>(Ljava/lang/Comparable;)V
Could someone please help me figure out what's going on? Thank you!
回答1:
Note that JCommon classes have been integrated into JFreeChart version 1.5.
When downloading old releases from here, be sure to use compatible versions: For example, the latest JFreeChart JAR, jfreechart-1.0.19, should be used with the latest JCommon JAR, jcommon-1.0.23. You should see the correct JCommon JAR in the lib folder of whichever JFreeChart you choose.
来源:https://stackoverflow.com/questions/53137373/jfreechart-no-such-method-error-despite-having-loaded-the-library