JFreeChart – Installation

JFreeChart is popular for its efficient chart creation and user-friendly installation setup. In this we describes the process of setting up JFreeChart on Windows and Linux. User administration is needed while installing JFreeChart.

System Requirements

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

Installing JFreeChart

To install JFreeChart, there are three following steps vizā€¦

Step 1: 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

Once Java installation is done properly, then you should get the following output for both the operating systems āˆ’

S.NoOS & Description
1WindowsJava 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)
2Linuxjava version “1.7.0_25” OpenJDK Runtime Environment (rhel2.3.10.4.el6_4-x86_64) OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)

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,

Append Java compiler location to System Path.

S.NoOS & Description
1WindowsAppend the String; C:\Program Files\Java\jdk1.7.0_60\bin to the end of the system variable PATH.
2Linuxexport PATH=$PATH:$JAVA_HOME/bin/

Verify the command java -version from the command prompted as explained above.

Step 3: 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 āˆ’

S.NoOS & Description
1WindowsAppend the Strings ā€œC:\ jfreechart-1.0.18\lib\ jfreechart-1.0.18.jarā€ and ā€œC:\ jfreechart-1.0.18\lib\ jcommon-1.0.22.jarā€ to the end of the user variable CLASSPATH
2LinuxExport CLASSPATH=$CLASSPATH: /usr/share/jfreechart1.0.18/lib/jfreechart-1.0.18.jar: /usr/share/jfreechart-1.0.18/lib/jcommon1.0.22.jar

Note āˆ’ Inorder to communicate with MySql database you need to set the classpath to mysql-connector-java-5.0.8-bin.jar too.

This Post Has One Comment

Leave a Reply