1

I am having trouble with setting up the open source library JFreeChart for creating charts using Java. This is the process I have followed so far in trying to set it up:

I downloaded the latest version from their download page http://sourceforge.net/projects/jfreechart/files/.

I then unpacked the jfreechart-1.0.13.zip in the directory C:\JFreeChart\jfreechart-1.0.13\ on my system drive.

In the unpacked directory there is a folder entitled "lib" which contains the packaged .jar files specified as necessary to use JFreeChart. I added the following directory to my classpath: C:\JFreeChart\jfreechart-1.0.13\lib\

I then created a simple program and added the line "import org.jfree.chart.*;" to see if it would compile with a package imported from JFreeChart. I navigated to the folder in which my sample program was contained and compiled with the following command: "javac -classpath C:\ Program.java"

I was given the following error: "package org.jfree.chart does not exist"

Could someone please give me some input as to what I have done incorrectly in this setup process? This is the first time I've tried using an open source library, so I don't have any prior experience to go on myself.

Thank you very much in advance.

Ry-
  • 218,210
  • 55
  • 464
  • 476
ssbellows
  • 35
  • 4
  • you are not using an ide, like eclipse? It is much easier this way... I am using JFreeChart and a lot of other open source libraries, but I have no idea how to do this manually... – Fortega Mar 24 '10 at 14:13
  • Using an IDE might be the best solution actually. You're right that it might be easier, as I think I know how to set up libraries in Eclipse. I have used Eclipse before, but up to this point I've been using Notepad2 to write my code and the command line to prompt compilation because I've found it less cumbersome. Looks like it's time to switch. – ssbellows Mar 24 '10 at 14:22
  • if you will always run the software from eclipse that's true. But if you want to deploy it sometime it's not wrong to understand the tools. – extraneon Mar 24 '10 at 14:34
  • @extraneon I think I've figured out my problem now actually. I had been trying before to do as you said in your answer below, but it turns out there was just one .jar that I had been missing that was necessary to use the library. So, I won't necessarily have to use an IDE. I understand the tools better now. – ssbellows Mar 24 '10 at 16:11

1 Answers1

2

I believe the classpath points to the jars, not the directory in which the jars live.

extraneon
  • 23,575
  • 2
  • 47
  • 51