aspose file tools*
The moose likes Java in General and the fly likes problem with jfreechart Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "problem with jfreechart" Watch "problem with jfreechart" New topic
Author

problem with jfreechart

albert sie
Ranch Hand

Joined: Jan 15, 2006
Posts: 108
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


JAVA the only can called technology
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

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.


[Jess in Action][AskingGoodQuestions]
albert sie
Ranch Hand

Joined: Jan 15, 2006
Posts: 108
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
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14269
    
  21

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


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
albert sie
Ranch Hand

Joined: Jan 15, 2006
Posts: 108
i set the classpath to the jfreechart jar file. but still cannot solve the problem, can suggest me the solution
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42285
    
  64
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.


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with jfreechart