How to get started with JFreeChart?

北城以北 提交于 2019-12-01 23:28:07

问题


I have downloaded the latest version of JFreeChart (1.0.14) and want to start using it. I only have imported standard Java packages like java.io.* before and never dealt with 3rd party libraries. What do I need to tell jGRASP so it knows about and can access the JFreeChart library? I have tried to import it like this import org.jfree.chart.ChartFactory; but getting the following error java:1: package org.jfree.chart does not exist.


回答1:


You have to add a library's jar file into both compile-time and run-time CLASSPATH. In jGRASP you can do it through "Settings > PATH/CLASSPATH > Workspace" dialog. See HOWTO, Control Panel and Settings for more details.




回答2:


By adding both jar libraries:

\jfreechart-1.0.14\lib\jfreechart-1.0.14.jar and
\jfreechart-1.0.14\lib\jcommon-1.0.17.jar 

into CLASSPATH, you will be able to use the library straight forward.



来源:https://stackoverflow.com/questions/9028516/how-to-get-started-with-jfreechart

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!