wood burning stoves 2.0*
The moose likes Other Open Source Projects and the fly likes JFreeChart installation problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "JFreeChart installation problem" Watch "JFreeChart installation problem" New topic
Author

JFreeChart installation problem

albert sie
Ranch Hand

Joined: Jan 15, 2006
Posts: 108
I already download the jfreechart-1.0.1 and extract to a file call jfreechart API. but i donno how to install the jfreechart to make the java compiler can recognize the library. i also already download the installation guide from the jfreechart but i don't understand what the installation guide talking about.
can someone here have this experienceteach me what to do.


thank you.



best regards,
Albert


JAVA the only can called technology
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

I donno how to install the jfreechart to make the java compiler can recognize the library


All you have to do is to put jcommon-1.0.0.jar and jfreechart-1.0.1.jar files in your classpath.

Have a look at a the demo:
java -jar jfreechart-1.0.1-demo.jar
[ February 22, 2006: Message edited by: Satou kurinosuke ]

[My Blog]
All roads lead to JavaRanch
albert sie
Ranch Hand

Joined: Jan 15, 2006
Posts: 108
i already put that two jar file in the classpath but it not work. i found the error when compile my java file. i can run the demo successfully

what is the problem is???
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

The problem is your file then
What are you doing ?
albert sie
Ranch Hand

Joined: Jan 15, 2006
Posts: 108
after i extract the jfreechart, then i recompile it using ant. i set the classpath to the jfreechart-1.0.1.jar and jcommon1.0.0.jar.
but when i compile my java, it come out the error message

First.java:1: package org.jfree.data does not exist
import org.jfree.data.DefaultPieDataset;
^
First.java:2: package org.jfree.chart does not exist
import org.jfree.chart.ChartFactory;
^
First.java:3: package org.jfree.chart does not exist
import org.jfree.chart.JFreeChart;
^
First.java:4: package org.jfree.chart does not exist
import org.jfree.chart.ChartFrame;
^


what the problem is?

is it i need to download the additional thing to make the API can run?
albert sie
Ranch Hand

Joined: Jan 15, 2006
Posts: 108
i solve my problem already than k for the help.
actually my problem is i set my classpath using the environment variable. but this method not use for me. then i try the second method where is send classpath by using the SET CLASSPATH command in the command prompt. this is the method which make the installation complete and i successfully compile my file and run it.so i post this for anyone that face the same problem can that this as the reference. thank you.



regards,
albert
Potter James
Greenhorn

Joined: Aug 18, 2008
Posts: 9
Can anyone tell me the way to recognise the JFREECHART to my java compiler step by step.I tried the way of setting class path.It did not work.So can someone tell a clear idea..
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41068
    
  43
How are you adding the jar files to the classpath? The easiest way is to use the "-classpath" switch, like

(use a colon instead of a semicolon on Unix systems)


Ping & DNS - my free Android networking tools app
Potter James
Greenhorn

Joined: Aug 18, 2008
Posts: 9
Ok.Now just tell me where to put the folder JFREECHART in the java installation directory.I have put that in bin.Also tried to zip it in "src".It is working if i put the jfree folder and my program in bin.But my aim is to run the coding in a JSP page.It is not recognizing the jfree package in "import" command.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41068
    
  43
It doesn't matter where the JFreeChart directory resides, but inside of the JDK installation seems a bad place, particularly the bin directory.

For web applications the jar files need to be inside of the WEB-INF/lib directory, since web apps don't use the standard classpath.
Potter James
Greenhorn

Joined: Aug 18, 2008
Posts: 9
I have executed the code finally..Thanks a lot for your tips
shanaya dutt
Greenhorn

Joined: Jul 02, 2009
Posts: 23
hii,im a fairly new programmer in java.I need to implement a polar graph that requires Jfreechart.but i'm having problems in the compiler recognising the jfree package.

i use command prompt and when i tried running the demo file
using java -jar jfreechart-1.0.13.jar

it throws the following errors

Exception in thread "main" java.lang.NoClassDefFoundError: org/jfree/ui/Applicat
ionFrame
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.jfree.ui.ApplicationFrame
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 12 more
Could not find the main class: demo.SuperDemo. Program will exit.


and if tried compiling my application using -classpath method...it throws an invalid flag error

C:\Documents and Settings\Administrator>javac -classpath C:\Documents and Settin
gs\Administrator\jfreechart-1.0.13\lib\jfreechart-1.0.13.jar;C:\Documents and Se
ttings\Administrator\jfreechart-1.0.13\lib\jcommon-1.0.16.jar polarpanel.java
javac: invalid flag: Settings\Administrator\jfreechart-1.0.13\lib\jfreechart-1.0
.13.jar;C:\Documents
Usage: javac <options> <source files>
use -help for a list of possible options


please help me...anyone?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19651
    
  18

Moving to Other Open Source Software


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41068
    
  43
shanaya dutt wrote:Exception in thread "main" java.lang.NoClassDefFoundError: org/jfree/ui/ApplicationFrame

You need to add the JCommon and JFreeChart Demo jar files to your classpath.

and if tried compiling my application using -classpath method...it throws an invalid flag error

If the classpath contains spaces then you need to quote it:

javac -classpath "C:\Documents and Settings\Administrator\jfreechart-1.0.13\lib\jfreechart-1.0.13.jar;C:\Documents and Settings\Administrator\jfreechart-1.0.13\lib\jcommon-1.0.16.jar" polarpanel.java
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JFreeChart installation problem
 
Similar Threads
Problems setting up JFreeChart in NetBeans
Java Charting library - Opinions
JFreeChart...
HOWTO: Charts to PDF
how to configure jfreechart in tomcat