kalibra
kalibra

Reputation: 139

How to get jfreechart to work in Eclipse (Windows 7)

I apologise if this question has been asked, I am new to programming and trying to learn more. Also sorry for being general, but I don't know what I don't know, if that makes any sense at all. It feels like I looked at every tutorial known to man about this, especially http://www.tutorialspoint.com/jfreechart/index.htm

Background: So I downloaded jfreechart, I don't know if it matters, but I saved the unzipped jfreechart folder in my project folder which is in my Eclipse workspace. In my Environment Variables I added a CLASSPATH variable, with paths to jfreechart-1.0.19.jar and jcommon-1.0.23.jar. Also in Eclipse in Window->Preferences->Java->Build Path->User Libraries, I made two new libraries, jcommon and jfreechart, I added the same external JARs, jfreechart-1.0.19.jar and jcommon-1.0.23.jar, respectively.

Problem: Eclipse still doesn't detect jfreechart. For example, when I type the following line: import org.jfree.ui.ApplicationFrame; Eclipse gives me the following error: The import org.jfree cannot be resolved. Obviously I missed something somewhere. What am I doing wrong, and why can't the import be resolved.

Upvotes: 2

Views: 9905

Answers (2)

Reza
Reza

Reputation: 1546

See page 31 of installation pdf in sourceforge. It explains how to use it in eclipse step by step. the link is here

Upvotes: 2

MajorT
MajorT

Reputation: 221

You need to add the jars that you want to use to the buildpath of the project. Rightclick your project in eclipse -> properties -> Java build path -> Libraries tab

There add the jar you want to include. This will tell eclipse that you want to use this jar and put its containing classes on the classpath.

Upvotes: 2

Related Questions