Hi there!!!
You cant imagine how much i appreciate your reply. The fact is that i have downloaded the jfreechart and jcommon package and i have extracted them. I have placed all of the folders in /JCommon/source/org/jfree in jfreechart-1.0.4/source/org/jfree . To be honest i havent work a lot in my life with packages or jar files in Java. Could you please illustrate me an example of how to rebuilt the jar files myself?
Thanks
how to rebuilt jar files
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Don't mix the JCommon and JFreeChart source trees - that just makes things more complicated.
The easiest way to build JCommon and JFreeChart is to use the Ant script included in the distribution (build.xml in the 'ant' subdirectory). You'll need to download and install Apache Ant, if you don't already have it. If you are a Java developer, spending a little time getting familiar with Ant is time well spent - it is used all over the place for building projects.
Both the JCommon and JFreeChart Ant scripts can be run by changing to the 'ant' subdirectory and typing 'ant all'. This will compile the sources, rebuild the jar files, generate the Javadocs etc. By magic.
The easiest way to build JCommon and JFreeChart is to use the Ant script included in the distribution (build.xml in the 'ant' subdirectory). You'll need to download and install Apache Ant, if you don't already have it. If you are a Java developer, spending a little time getting familiar with Ant is time well spent - it is used all over the place for building projects.
Both the JCommon and JFreeChart Ant scripts can be run by changing to the 'ant' subdirectory and typing 'ant all'. This will compile the sources, rebuild the jar files, generate the Javadocs etc. By magic.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


Ok, now i think that i ve done all that you said. I installed Ant software and i went to 'jfreechart/ant' and used 'ant all' command and the whole package was rebuilt successfully. I did the same for jcommon. But now what comes after that is that i am unable to run the jfreechart-1.0.4.jar file.
What i am interested in is to run that demo. Any idea how i can do that?
Thanks for your time
This is what i get. Is there anything that i am doing wrong? I also put a new demo file in '/org/jfree/chart/demo' where i found it in http://www.java2s.com/Code/Java/Chart/J ... points.htmBT jfreechart-1.0.4 $ java -jar jfreechart-1.0.4.jar
Failed to load Main-Class manifest attribute from
jfreechart-1.0.4.jar
What i am interested in is to run that demo. Any idea how i can do that?
Thanks for your time
Can anyone help me here?
I have file call first.java which is in path "C:\Java\jfreechart1.0.10\Examples". I have installed jfreechart and jcommon which are in paths "C:\Java\jfreechart1.0.10\jfreechart-1.0.10" and "C:\Java\jfreechart1.0.10\jcommon-1.0.13" respectively.
First.java
package org.jfree;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartFrame;
import org.jfree.chart.JFreeChart;
import org.jfree.data.general.DefaultPieDataset;
public class First {
public static void main(String[] args) {
// create a dataset...
DefaultPieDataset dataset = new DefaultPieDataset();
dataset.setValue("Category 1", 43.2);
dataset.setValue("Category 2", 27.9);
dataset.setValue("Category 3", 79.5);
// create a chart...
JFreeChart chart = ChartFactory.createPieChart(
"Sample Pie Chart",
dataset,
true, // legend?
true, // tooltips?
false // URLs?
);
// create and display a frame...
ChartFrame frame = new ChartFrame("First", chart);
frame.pack();
frame.setVisible(true);
}
}
I'm compiling this file from the path in command line as follows
C:\Java\jfreechart1.0.10\Examples>javac first.java
I'm getting errors. Can anyone help me here?
I have file call first.java which is in path "C:\Java\jfreechart1.0.10\Examples". I have installed jfreechart and jcommon which are in paths "C:\Java\jfreechart1.0.10\jfreechart-1.0.10" and "C:\Java\jfreechart1.0.10\jcommon-1.0.13" respectively.
First.java
package org.jfree;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartFrame;
import org.jfree.chart.JFreeChart;
import org.jfree.data.general.DefaultPieDataset;
public class First {
public static void main(String[] args) {
// create a dataset...
DefaultPieDataset dataset = new DefaultPieDataset();
dataset.setValue("Category 1", 43.2);
dataset.setValue("Category 2", 27.9);
dataset.setValue("Category 3", 79.5);
// create a chart...
JFreeChart chart = ChartFactory.createPieChart(
"Sample Pie Chart",
dataset,
true, // legend?
true, // tooltips?
false // URLs?
);
// create and display a frame...
ChartFrame frame = new ChartFrame("First", chart);
frame.pack();
frame.setVisible(true);
}
}
I'm compiling this file from the path in command line as follows
C:\Java\jfreechart1.0.10\Examples>javac first.java
I'm getting errors. Can anyone help me here?
sac