JFreeChartDemo

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Phillip

JFreeChartDemo

Post by Phillip » Tue Jul 23, 2002 5:56 pm

I can't get the JFreeChartDemo to run. I have the SDK 1_4 installed. When I run the command provided in the JFreeChart Installation Instructions (pg. 14) I get error: Exception in thread "main" java.lang.NoClassDefFoundError: com/jrefinery/chart/demo/jfreechartdemo.
My JFree chart is unpacked to C:\jfreechart-0.9.2. I am running Windows.
How do I modify the "C:\java -classpath %jarfiles% com.jrefinery.chart.demo.JFreeChartDemo" in order for the demo to run?-

Sam

Re: JFreeChartDemo

Post by Sam » Tue Jul 23, 2002 6:19 pm

You should use Sun ONE Studio. It is a visual environment that is very easy to use.

Julian

Re: JFreeChartDemo

Post by Julian » Tue Jul 23, 2002 7:58 pm

I got the same type of errors using Sun One Studio. I mounted the jcommon and jfreechart directories. Class compiles, but get same errors when I execute the program. Thanks.

Geoff Granum

Re: JFreeChartDemo

Post by Geoff Granum » Tue Jul 23, 2002 11:07 pm

I had the same problem.

In the readme file the command has a ':' instead of a ';' part way through the path statement. CD to the 'jars' directory then paste and run this command:

java -classpath jcommon-0.6.4.jar;jfreechart-0.9.2.jar;jfreechart-0.9.2-demo.jar com.jrefinery.chart.demo.JFreeChartDemo

Should work.

Camilla

Re: JFreeChartDemo

Post by Camilla » Wed Jul 24, 2002 12:24 pm

Hello, I have the same problem, and I have tried everything that is written here. ANd I still get the same error message!
Can someone please help us.

Thanks

David Gilbert

Re: JFreeChartDemo

Post by David Gilbert » Wed Jul 24, 2002 12:30 pm

Please post a transcript of the command you entered and the exception generated, and I'll try to help.

Regards,

DG.

Julian

Re: JFreeChartDemo

Post by Julian » Wed Jul 24, 2002 3:41 pm

I tried compiling and running XYSeriesDemo.java
Located in com/jrefinery/chart/demo

I get the following errors:

demo/XYSeriesDemo.java [5:1] package com.jrefinery.data does not exist
import com.jrefinery.data.XYSeries;
^
demo/XYSeriesDemo.java [6:1] package com.jrefinery.data does not exist
import com.jrefinery.data.XYSeriesCollection;
^
demo/XYSeriesDemo.java [7:1] package com.jrefinery.ui does not exist
import com.jrefinery.ui.ApplicationFrame;
^
demo/XYSeriesDemo.java [8:1] package com.jrefinery.chart does not exist
import com.jrefinery.chart.JFreeChart;
^
demo/XYSeriesDemo.java [9:1] package com.jrefinery.chart does not exist
import com.jrefinery.chart.ChartFactory;
^
demo/XYSeriesDemo.java [10:1] package com.jrefinery.chart does not exist
import com.jrefinery.chart.ChartPanel;
^
demo/XYSeriesDemo.java [12:1] cannot resolve symbol
symbol : class ApplicationFrame
location: class com.jrefinery.chart.demo.XYSeriesDemo
public class XYSeriesDemo extends ApplicationFrame {
^
demo/XYSeriesDemo.java [14:1] cannot resolve symbol
symbol : class XYSeries
location: class com.jrefinery.chart.demo.XYSeriesDemo
protected XYSeries series;
^
demo/XYSeriesDemo.java [21:1] cannot resolve symbol
symbol : class XYSeries
location: class com.jrefinery.chart.demo.XYSeriesDemo
this.series = new XYSeries("40SUC");
^
demo/XYSeriesDemo.java [141:1] cannot resolve symbol
symbol : class XYSeriesCollection
location: class com.jrefinery.chart.demo.XYSeriesDemo
XYSeriesCollection data = new XYSeriesCollection(series);
^
demo/XYSeriesDemo.java [141:1] cannot resolve symbol
symbol : class XYSeriesCollection
location: class com.jrefinery.chart.demo.XYSeriesDemo
XYSeriesCollection data = new XYSeriesCollection(series);
^
demo/XYSeriesDemo.java [142:1] cannot resolve symbol
symbol : class JFreeChart
location: class com.jrefinery.chart.demo.XYSeriesDemo
JFreeChart chart = ChartFactory.createXYChart("XY Series Demo", "X", "Y", data, true);
^
demo/XYSeriesDemo.java [142:1] cannot resolve symbol
symbol : variable ChartFactory
location: class com.jrefinery.chart.demo.XYSeriesDemo
JFreeChart chart = ChartFactory.createXYChart("XY Series Demo", "X", "Y", data, true);
^
demo/XYSeriesDemo.java [145:1] cannot resolve symbol
symbol : class ChartPanel
location: class com.jrefinery.chart.demo.XYSeriesDemo
ChartPanel chartPanel = new ChartPanel(chart);
^
demo/XYSeriesDemo.java [145:1] cannot resolve symbol
symbol : class ChartPanel
location: class com.jrefinery.chart.demo.XYSeriesDemo
ChartPanel chartPanel = new ChartPanel(chart);
^
demo/XYSeriesDemo.java [155:1] cannot resolve symbol
symbol : method pack ()
location: class com.jrefinery.chart.demo.XYSeriesDemo
demo.pack();
^
demo/XYSeriesDemo.java [156:1] cannot resolve symbol
symbol : method setVisible (boolean)
location: class com.jrefinery.chart.demo.XYSeriesDemo
demo.setVisible(true);
^
17 errors
Errors compiling class XYSeriesDemo.

Phillip

Re: JFreeChartDemo

Post by Phillip » Wed Jul 24, 2002 11:34 pm

Thanks Geoff, this worked! (1) I unzipped JFreeChart-0.9.2 to the root of C:\ on Windows. (2) I ran the command listed in Geoff's post from the Jars directory. my command prompt looked like:

C:\C:\jfreechart-0.9.2\jars>java -classpath jcommon-0.6.4.jar;jfreechart-0.9.2.jar;jfreechart-0.9.2-demo.jar com.jrefinery.chart.demo.JFreeChartDemo

This worked. I did not do any other compiling of specific java files. The JFreeChartDemo runs an app that displays all of the different charts available through JFreeChartDemo.

Also, the command is case sensitive! At one point my manager and I did run the right command from the right directory, but it was in the wrong case so it failed.

David Gilbert

Re: JFreeChartDemo

Post by David Gilbert » Thu Jul 25, 2002 3:19 pm

You need to specify the sourcepath so that the compiler knows where to find those other files.

Regards,

DG.

Reggie

Re: JFreeChartDemo

Post by Reggie » Thu Aug 01, 2002 12:24 pm

According to what Geoff Granum had shown us, it works on me. I simply changed the ":" to ";", and it worked.

ruxin cai

Re: JFreeChartDemo

Post by ruxin cai » Thu Aug 08, 2002 7:58 am

I have been shown the JFreeChartDemo in JBuilder7 IDE. But before i used the all demos, i have recompiled all the source codes. some problem occured while i done it. but i can not remember all the errors, if you want to know it, give me a mail address, i can send it to you.
problems like above, maybe it happens caused by Environment Setting.

Locked