
I have this little piece of code from the web
Code: Select all
import org.jfree.chart.*;
import org.jfree.data.*;
public class TheFuture {
public static void main(String[] args) {
XYSeries series = new XYSeries("Linux Users");
series.add(1995, 0.5);
series.add(2000, 3.0);
series.add(2010, 20.0);
series.add(2020, 50.0);
XYDataset dataset = new XYSeriesCollection(series);
JFreeChart chart = ChartFactory.createXYAreaChart(
"Linux Users",
"Year",
"Millions",
dataset,
org.jfree.chart.plot.PlotOrientation.VERTICAL,
true,
false,
false);
try {
ChartUtilities.saveChartAsJPEG(new java.io.File("TheFuture.jpg"), chart, 500, 300);
} catch (java.io.IOException exc) {
System.err.println("Error writing image to file");
}
}
}
javac -classpath jfreechart-0.9.18.jar;lib\jcommon-0.9.3.jar TheFuture.java
but I can not execute it,
when i do:
java -classpath jfreechart-0.9.18.jar TheFuture
i get the message
Exception in thread "main" java.lang.NoClassDefFoundError: TheFuture
Please advise
Thanks Nathan