my dog learned polymorphism*
The moose likes Other Open Source Projects and the fly likes jFreeChart Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "jFreeChart" Watch "jFreeChart" New topic
Author

jFreeChart

Rob Hunter
Ranch Hand

Joined: Apr 09, 2002
Posts: 818
I'm looking at how jFreeChart is currently installed on a local working server, there's a directory that looks like .../org/jfree/ with chart, data, etc.., directories underneath it, ........ It's an older version of jFreeChart, not exactly sure how it was initially installed. I'm hoping to install 1.0.16 now and after downloading and unzipping it the structure of the directories for it appear to be somewhat difference (i.e. instead of org/jfree/chart..... it looks as though it's org/jfree/examples/chart.....). The imports in one of the working JSPs currently residing on the server looks like this :



Is there something additional I need to do to install 1.0.16? This isn't a case of having to re-write all paths to the classes, would it?!? Help = much appreciated.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

I would assume that "org/jfree/examples/..." would just be examples of jFreeChart and not the product itself. Are you sure you unzipped the right jar file?

(And by the way, if you're downloading jar files it's better to just put the appropriate jar file into the classpath, rather than unzipping it into a directory and putting that directory into the classpath.)
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41599
    
  55
You also need the JCommon library. Not sure which version goes with JFreeChart 1.0.16, but it's generally safe to use the most recent versions of both together. That would be JFreeChart 1.0.17 and JCommon 1.0.21.


Ping & DNS - my free Android networking tools app
Rob Hunter
Ranch Hand

Joined: Apr 09, 2002
Posts: 818
#1. on page http://sourceforge.net/projects/jfreechart/files/. I downloaded and unzipped it in proper directory but no corresponding directory listing.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41599
    
  55
What do you mean by "directory listing"? The file to get is on http://sourceforge.net/projects/jfreechart/files/1.%20JFreeChart/1.0.17/ - it includes the JFreeChart and JCommon jar files (which, as Paul said, should not be unpacked).
Rob Hunter
Ranch Hand

Joined: Apr 09, 2002
Posts: 818
I didn't "unpack" a jar when I downloaded, just unzipped the .zip file. Not sure what was done beforehand with the old version, looks as though as .jar was unpacked but not sure.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41599
    
  55
Is this a web app? If so, put the jfreechart and jcommon jar files (and possibly some of the others, if you're doing more advanced stuff with the library) into WEB-INF/lib and you're done. Make sure there aren't any loose class files in the classes directory, like org/jfree/...

Edit: Oh yes, you said JSP, so it's a web app. In that case, may I humbly suggest you check out the cewolf tag library (which is maintained by me). Get the example web app from http://sourceforge.net/projects/cewolf/files/example%20web-app/cewolf-1.2.4/, drop it into your webapps folder, and browse through some of the examples - it's easier to create charts in JSP web apps that way, in my admittedly biased opinion.
Rob Hunter
Ranch Hand

Joined: Apr 09, 2002
Posts: 818
Hi Ulf,
It's actually a Java applet, running on a Windows server. The applet can be used on various plain html pages and so forth, that was the idea. There are a few java classes that use the current version of jFreeChart that reside in a browsable directory and that is where the org/jfree directory is currently located (looks as though unpacked there).

Rob
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41599
    
  55
Ah, in that case they need to be in a public directory. I would switch from a hierarchy of loose class files to using the jar files, though.
Rob Hunter
Ranch Hand

Joined: Apr 09, 2002
Posts: 818
When I downloaded the jFreeChart and JCommon downloads I took a look at their contents using Windows Explorer. There is only 1 directory inside each zip and there isn't a jar file. Also I don't see any .class files just the source code. After downloading what steps should be taken to get the code compiled and everything placed in a .jar if that's what should be done. I've noticed posts mention not to "unpack" the .jar but there doesn't appear to be a .jar file to start with, just the jfreechart-1.0.17 directory in the .zip file.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Inside that zip file there's one directory called "jFreeChart-something". Inside that directory there's a "lib" directory containing a lot of jar files. Choose from them.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41599
    
  55
That's odd - the zip I downloaded from the link I posted yesterday contained a bunch of jar files in the "lib" directory. You don't need to compile anything, the jar files come ready for use. You do need to unpack the zip file to get at them, though.
Rob Hunter
Ranch Hand

Joined: Apr 09, 2002
Posts: 818
Hey Ulf,
Some of the documentation said the main directory should contain the jars
, I noticed them in the lib as well. Thanks for the post. Since I'll be just using with applets on my Windows machine do I just put them in a public location and import as I stated in initial post?

Rob
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41599
    
  55
Yes, but you also need to list them in the archive attribute of your applet tag: http://docs.oracle.com/javase/tutorial/deployment/applet/html.html
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: jFreeChart