• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problems setting up JFreeChart in NetBeans

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just followed the directions for JFreeChart http://www.jfree.org/ completely (except for the Ant and Javadoc parts) and for some reason NetBeans is still not finding the library since it's saying "cannot find symbol. symbol: class DefaultPieDataSet" etc. with the sample code in the installation guide.

The installation guide says to add as library in NetBeans using Library Manager and I specified the classpath JARs and sources directories for both JFreeChart and JCommon. Then I added the libraries to my existing project, and then when that didn't work I created a new one just like the guide says. Installation guide can be found here - http://surfnet.dl.sourceforge.net/project/jfreechart/2.%20Documentation/1.0.13/jfreechart-1.0.13-install.pdf. I also tried imports like "import org.jfree.*;" with no luck. It doesn't have an error on the import but still does on the rest of the code.

I'm fairly new to NetBeans but I've already got the JavaMail library working fine so I thought this would be easy with the instructions.

Ah then I thought I needed to add the directories to the classpath since I saw I had put JavaMail there (on Windows). Annoying since I don't want to have to do this on whatever server I use too but I tried it. I added directories for where I put it, the lib directory of jfreechart-1.0.13, and the jcommon-1.0.16 directory.
;C:\Program Files\Java\jfreechart-1.0.13\lib;C:\Program Files\Java\jcommon-1.0.16;
That didn't work either however.

Any help is appreciated!
 
Marshal
Posts: 79151
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't know. Sorry. I think this thread would fit better on our IDEs forum. Moving.
 
Rancher
Posts: 43081
77
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Michael Kato wrote:I added directories for where I put it, the lib directory of jfreechart-1.0.13, and the jcommon-1.0.16 directory.
;C:\Program Files\Java\jfreechart-1.0.13\lib;C:\Program Files\Java\jcommon-1.0.16;


The classpath does not contain directories, it contains jar files - you need to add the JCommon and JFreeChart jar files explicitly. The specific class you're missing is in package org.jfree.data.general, so make sure you have that import statement.
 
Michael Kato
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah I meant I added those to my PATH environment variable in system settings.

I did select the JAR when setting the classpath as I add those as libraries in NetBeans.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't add anything to the PATH; it plays no role here.

Does this mean the problem is now solved?
 
Michael Kato
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, NetBeans/Java is not seeing the library despite it showing up under Libraries. I can't compile and of course there are highlighted code errors.

I could probably pull out the source I need and make a new Source Package so I can use it but it would be so much better to get this working.
 
Michael Kato
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh my god I didn't put in the imports, it's the last step of the guide (on different page) - Fix Imports.
Never used Fix Imports before, nice. Ok problem solved now.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic