[Logo]
Forums Register Login
problem with jfreechart
i cannot solve my program that using jfreechart api
here is my code:


here is my problem:

C:\>javac First.java
First.java:5: cannot find symbol
symbol : class DefaultPieDataset
location: package org.jfree.data
import org.jfree.data.DefaultPieDataset;
^
First.java:14: cannot find symbol
symbol : class DefaultPieDataset
location: class First
DefaultPieDataset dataset = new DefaultPieDataset();
^
First.java:14: cannot find symbol
symbol : class DefaultPieDataset
location: class First
DefaultPieDataset dataset = new DefaultPieDataset();
^
3 errors


any one can suggest to me??


regards,
albert
Google told me very quickly that this class is in package "org.jfree.data.general". You're trying to import it from the wrong package.
i can compile successfully now. but when i want to run my program another problem come out again,

Exception in thread "main" java.lang.NoClassDefFoundError: First

i'm sure that the ocation i save and the file name is correct
What is your classpath set to? That error means that Java can't find your class. You must set the classpath so that Java can find your class.

Setting the class path
i set the classpath to the jfreechart jar file. but still cannot solve the problem, can suggest me the solution
Yes, but the missing class is not one of the JFree classes, it's "First" - probably one of your classes. It needs to be in the classpath as well.

This thread has been viewed 2746 times.

All times above are in ranch (not your local) time.
The current ranch time is
Sep 26, 2018 02:23:04.