Getting "cannot resolve symbol" errors.

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
jmartin_lws
Posts: 2
Joined: Tue Oct 04, 2005 1:02 am

Getting "cannot resolve symbol" errors.

Post by jmartin_lws » Tue Oct 04, 2005 1:42 am

Hello,

Forgive me if this is a stupid question, but I am having trouble compiling the First.java on the Developer Guide documentation. I am getting the error "cannot resolve symbol" on all the imports. I have followed everything on the guide and was successfull in doing everything up to this point. What did I miss?

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 » Tue Oct 04, 2005 5:48 pm

Post the exact command line you entered and the error displayed.
David Gilbert
JFreeChart Project Leader

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

jmartin_lws
Posts: 2
Joined: Tue Oct 04, 2005 1:02 am

Post by jmartin_lws » Tue Oct 04, 2005 6:21 pm

Hello Dave,

This is what I am getting:

C:\jfreechart-1.0.0-rc1>javac First.java
First.java:1: package org.jfree.chart does not exist
import org.jfree.chart.ChartFactory;

.
.
.

First.java:16: cannot resolve symbol
symbol : class DefaultPieDataset
location: class First
DefaultPieDataset dataset = new DefaultPieDataset();


These are the paths:

PATH=c:\j2sdk1.4.2_07\bin\;c:\jfreechart-1.0.0-rc1\;c:\apache-ant1.6.5\bin\

Thank you for your quick response.

Regards,

jmartin

michael75
Posts: 16
Joined: Thu Sep 15, 2005 4:42 pm

Post by michael75 » Wed Oct 05, 2005 9:16 am

This is not a problem of jfreechart. Try to get a good book to find out more about java. In this case you forgot to tell the java compiler where to find the jfreechart library. The easiest way is to copy jfreechart-1.0.0-rc1.jar into the same directory as your First.java file and compile it like this:
javac -classpath jfreechart-1.0.0-rc1.jar First.java

Notice that for execution you have to specify the path of your resulting class file and the jfreechart library. Example:
java -classpath .;jfreechart-1.0.0-rc1.jar First

Locked