This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems setting up JFreeChart in NetBeans

 
Michael Kato
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • 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!
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know. Sorry. I think this thread would fit better on our IDEs forum. Moving.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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
  • 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: 42967
73
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic