JFreeChart Installation

JFreeChart Installation

This chapter takes you through the process of setting up JFreeChart on Windows and Linux. User administration is needed while installing the JFreeChart. The JFreeChart is famous for its efficient chart creation, and user-friendly installation setup.

System Requirements :

JDK1.5 or above
Memory2GB RAM
Disk SpaceNo minimum requirement
Operating System VersionLinux or Windows

Installing JFreeChart

To install JFreeChart, first you need to install Java on your system.

Step1: Verifying Java Installation

To verify Java installation, open the console and execute the following java command :

OsTaskCommand
WindowsOpen command consoleC:>java -version
LinuxOpen command terminal$java -version

If Java installation is done properly, then you should get the following output for both the operating systems :

OSDescription
WindowsJava version “1.7.0_60” Java (TM) SE Run Time Environment (build 1.7.0_60-b19) Java HotSpot(TM) 64-bit Server VM (build 24.60-b09,mixed mode)
Linuxjava version “1.7.0_25” OpenJDK Runtime Environment (rhel-2.3.10.4.el6_4-x86_64) OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)

 

We assume that you have installed Java 1.7.0_60 version before proceeding for this tutorial.

Step 2: Setting JAVA Environment

Set the JAVA_HOME environment variable to point to the base directory location where Java is installed on your machine. For example,

OsDescription
WindowsSet Environmental varible JAVA_HOME to C:ProgramFilesjavajdk1.7.0_60
Linuxexport JAVA_HOME=/usr/local/java-current

Append Java compiler location to System Path.

OSDescription
WindowsAppend the String; C:Program FilesJavajdk1.7.0_60bin to the end of the system variable PATH.
Linuxexport PATH=$PATH:$JAVA_HOME/bin/

Verify the command java -version from command prompt as explained above

Step3: Installing JFreeChart

Download the latest version of JFreeChart.zip from the link http://www.jfree.org/jfreechart/download/ Unzip the downloaded file at any location from where required libraries can be linked into your Java program. The following image shows the structure of the directories and files :

Add complete path of jfreechart-1.0.18.jar and jcommon-1.0.22.jar files to the CLASSPATH as shown below :

OSDescription
WindowsAppend the Strings “C: jfreechart-1.0.18lib jfreechart-1.0.18.jar” and “C: jfreechart-1.0.18lib jcommon-1.0.22.jar” to the end of the user variable CLASSPATH
LinuxExport CLASSPATH=$CLASSPATH: /usr/share/jfreechart-1.0.18/lib/jfreechart-1.0.18.jar: /usr/share/jfreechart-1.0.18/lib/jcommon-1.0.22.jar

Was this article helpful?

Related Articles

Leave A Comment?

You must be logged in to post a comment.