Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

problem with jfreechart  RSS feed

 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
author and iconoclast
Sheriff
Posts: 24220
40
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
albert sie
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Java Cowboy
Sheriff
Posts: 16084
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
albert sie
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i set the classpath to the jfreechart jar file. but still cannot solve the problem, can suggest me the solution
 
Rancher
Posts: 42975
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!