aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes Problems setting up JFreeChart in NetBeans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Problems setting up JFreeChart in NetBeans" Watch "Problems setting up JFreeChart in NetBeans" New topic
Author

Problems setting up JFreeChart in NetBeans

Michael Kato
Greenhorn

Joined: Aug 06, 2010
Posts: 12
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

Joined: Oct 13, 2005
Posts: 38793
    
  23
Don't know. Sorry. I think this thread would fit better on our IDEs forum. Moving.
Ulf Dittmer
Marshal

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


Ping & DNS - my free Android networking tools app
Michael Kato
Greenhorn

Joined: Aug 06, 2010
Posts: 12
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
Marshal

Joined: Mar 22, 2005
Posts: 41830
    
  63
Don't add anything to the PATH; it plays no role here.

Does this mean the problem is now solved?
Michael Kato
Greenhorn

Joined: Aug 06, 2010
Posts: 12
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

Joined: Aug 06, 2010
Posts: 12
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problems setting up JFreeChart in NetBeans