Hi Everybody,
I desperately need help as I could not even start using JFreeChart yet. As I write "ant compile" , it says that the build was successful and creates a jfreechart-1.0.0-pre2.jar file in the jfreechart-1.0.0-pre2 folder. However, when I am trying to import org.jfree.* it says that there is no such package.
Do I have to do something with the .jar file?
Please help.
Thanks
Birgi
Can't make it work!!!
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Don't say "does not work", post the exception text or the error message. Otherwise no-one can tell what might be wrong.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


Dave,
I did the following. Project > Properties > Required Libraries > New
Then a Set Library window appeared. I set the Name to "JFreeChart" and did Add > Add Archive and chosed the .jar file created after the "ant compile" command.
Now JFreeChart appears in my Required Libraries list and it is checked.
Also there is a "Classpath:" part and the following is written in this part;
***
C:\My Documents\ProChartTable\classes;C:\My Documents\programs\jfreechart-1.0.0-pre2\jfreechart-1.0.0-pre2\jfreechart-1.0.0-pre2.jar;c:\j2sdk1.4.2_06\jre\lib\rt.jar;c:\j2sdk1.4.2_06\lib\dt.jar;c:\j2sdk1.4.2_06\lib\tools.jar;c:\j2sdk1.4.2_06\jre\lib\ext\dnsns.jar;c:\j2sdk1.4.2_06\jre\lib\ext\ldapsec.jar;c:\j2sdk1.4.2_06\jre\lib\ext\sunjce_provider.jar;c:\j2sdk1.4.2_06\jre\lib\ext\localedata.jar
***
After doing this I add the line;
import org.jfree.*;
in one of my project files and try to compile the project.
It gives the following error;
***
C:\My Documents\ProChartTable\src\ProChartTable.java:7: package org.jfree does not exist
import org.jfree.*;
^
1 error
***
Thanks
Birgi
I did the following. Project > Properties > Required Libraries > New
Then a Set Library window appeared. I set the Name to "JFreeChart" and did Add > Add Archive and chosed the .jar file created after the "ant compile" command.
Now JFreeChart appears in my Required Libraries list and it is checked.
Also there is a "Classpath:" part and the following is written in this part;
***
C:\My Documents\ProChartTable\classes;C:\My Documents\programs\jfreechart-1.0.0-pre2\jfreechart-1.0.0-pre2\jfreechart-1.0.0-pre2.jar;c:\j2sdk1.4.2_06\jre\lib\rt.jar;c:\j2sdk1.4.2_06\lib\dt.jar;c:\j2sdk1.4.2_06\lib\tools.jar;c:\j2sdk1.4.2_06\jre\lib\ext\dnsns.jar;c:\j2sdk1.4.2_06\jre\lib\ext\ldapsec.jar;c:\j2sdk1.4.2_06\jre\lib\ext\sunjce_provider.jar;c:\j2sdk1.4.2_06\jre\lib\ext\localedata.jar
***
After doing this I add the line;
import org.jfree.*;
in one of my project files and try to compile the project.
It gives the following error;
***
C:\My Documents\ProChartTable\src\ProChartTable.java:7: package org.jfree does not exist
import org.jfree.*;
^
1 error
***
Thanks
Birgi
You forgot to add JCommon to your classpath. It is common for projects to put all required libraries inside a "lib" directory.
After extracting the jfreechart-distribution archive, you will find a "lib" directory there, which contains the "jcommon" jar file. Make sure, that this one is also on your classpath.
Have mo' fun,
said Thomas
After extracting the jfreechart-distribution archive, you will find a "lib" directory there, which contains the "jcommon" jar file. Make sure, that this one is also on your classpath.
Have mo' fun,
said Thomas