help: running jfreechart in linux

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
jezzy_ph
Posts: 3
Joined: Wed Mar 03, 2004 6:34 am

help: running jfreechart in linux

Post by jezzy_ph » Wed Mar 03, 2004 6:51 am

Hi,

I was able to successfully install jfreechart in Linux Redhat 9.0, but the problem is that java doesn't seem to detect that I am importing files from the jfreechart.jar so I alway end up with an error.

Am I doing something wrong? What I did was extract the tar.gz file as instructed in the installation manual.....do i need to configure anything before I can use JFreeChart?

Help Please!!!!

Thanks,
Jessamine

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 » Wed Mar 03, 2004 9:50 am

Tell us what you are trying to do, and post the error message.
David Gilbert
JFreeChart Project Leader

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

dennislee
Posts: 13
Joined: Mon Feb 23, 2004 3:02 am
Location: beijing, china

please check your classpath

Post by dennislee » Wed Mar 03, 2004 11:02 am

Hi

please check your classpath if it not be setted, do like this
# export classpath = /opt/jfreechart/xxx(your install paht);

jezzy_ph
Posts: 3
Joined: Wed Mar 03, 2004 6:34 am

error encountered

Post by jezzy_ph » Thu Mar 04, 2004 4:33 pm

Hi, this is the error that I'm getting.....I know that linux does not understand that it has to access these classes from the jfreechart.jar file.... the problem is I don't know how to make it work.

I tried the suggestion given by davidlee but I'm still getting errors.....what I entered was:

export classpath=/opt/jfreechart/root/Clumsy/jfreechart-0.9.16/jfreechart-0.9.16.jar

is this right?

Help Please!!

Errors encountered:

./SystemMonitorGraph.java:14: package org.jfree.chart does not exist
import org.jfree.chart.ChartFactory;
^
./SystemMonitorGraph.java:15: package org.jfree.chart does not exist
import org.jfree.chart.ChartPanel;
^
./SystemMonitorGraph.java:16: package org.jfree.chart does not exist
import org.jfree.chart.JFreeChart;
^
./SystemMonitorGraph.java:17: package org.jfree.chart.axis does not exist
import org.jfree.chart.axis.ValueAxis;
^
./SystemMonitorGraph.java:18: package org.jfree.chart.plot does not exist
import org.jfree.chart.plot.XYPlot;
^
./SystemMonitorGraph.java:19: package org.jfree.data.time does not exist
import org.jfree.data.time.Millisecond;
^
./SystemMonitorGraph.java:20: package org.jfree.data.time does not exist
import org.jfree.data.time.TimeSeries;
^
./SystemMonitorGraph.java:21: package org.jfree.data.time does not exist
import org.jfree.data.time.TimeSeriesCollection;
^
./SystemMonitorGraph.java:22: package org.jfree.ui does not exist
import org.jfree.ui.ApplicationFrame;
^
./SystemMonitorGraph.java:23: package org.jfree.ui does not exist
import org.jfree.ui.RefineryUtilities;

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 » Fri Mar 05, 2004 4:13 pm

I find it is easier to specify the classpath using the -classpath command line option of whatever utility you are using ('java', 'javac' etc.).

You didn't say whether you were compiling JFreeChart or running a demo or something else. But the error message is saying the JVM cannot find classes that are in the jfreechart-0.9.16.jar file, so your classpath setting is incorrect.
David Gilbert
JFreeChart Project Leader

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

kala
Posts: 3
Joined: Fri Mar 05, 2004 2:01 pm

Post by kala » Fri Mar 05, 2004 4:20 pm

Setting the classpath environment variable is not generally recommended under Java2. The easier way is to simply copy the jfreechart jar file (and its dependancies like jcommon) into the jre/lib/ext folder of your JDK installation (and get rid of the classpath setting altogether)

BK

Locked