Can't make it work!!!

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Birgi
Posts: 21
Joined: Mon Mar 14, 2005 9:09 pm

Can't make it work!!!

Post by Birgi » Wed Mar 16, 2005 7:45 pm

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

jerrys

Post by jerrys » Thu Mar 17, 2005 12:24 am

you need to include it in your classpath

Birgi
Posts: 21
Joined: Mon Mar 14, 2005 9:09 pm

Post by Birgi » Thu Mar 17, 2005 7:29 am

jerrys,

I am using JCreator LE. How can I add it to my classpath?

Thanks

Birgi

Birgi
Posts: 21
Joined: Mon Mar 14, 2005 9:09 pm

Post by Birgi » Thu Mar 17, 2005 7:43 am

jerrys,

I do the following,

Project > Properties > Required Libraries > New > Add Archive >

and select the created .jar file. But it still does not work???

Thanks

Birgi

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Thu Mar 17, 2005 9:30 am

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

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Birgi
Posts: 21
Joined: Mon Mar 14, 2005 9:09 pm

Post by Birgi » Thu Mar 17, 2005 11:43 am

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

Taqua
JFreeReport Project Leader
Posts: 698
Joined: Fri Mar 14, 2003 3:34 pm
Contact:

Post by Taqua » Thu Mar 17, 2005 12:08 pm

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

Birgi
Posts: 21
Joined: Mon Mar 14, 2005 9:09 pm

Post by Birgi » Thu Mar 17, 2005 8:23 pm

Taque,

Thank you very much. At the end I could see "Process Completed." Now there is only one thing left, learning JFreeChart :D.

Thanks again

Birgi

Locked