Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2010
    Rep Power

    Default JfreeChart.. how to plot????? help needed

    Hii.. I am using Jfreechart to plot a time series graph..
    i studied the tutorial for that and copied a sample code so as to understand..
    I am using netbeabs 6.8.. and i downloaded .jar file of jfreechart from the internet..

    i added the jar file in the library tab of a new project in Java...
    and copied the code in the main file..

    It is giving the following error...
    i guess there is some problem may be with importing files etc..
    can anyone help me to solve it??

    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logger
    at org.jfree.chart.axis.Axis.<clinit>(
    at org.jfree.chart.ChartFactory.createTimeSeriesChart (
    at javaapplication23.TimeSeriesDemo.createChart(TimeS
    at javaapplication23.TimeSeriesDemo.<init>(TimeSeries
    at javaapplication23.TimeSeriesDemo.main(TimeSeriesDe
    Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
    at$ 217)
    at Method)
    at ava:205)
    at java.lang.ClassLoader.loadClass( 21)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche
    at java.lang.ClassLoader.loadClass( 66)
    at java.lang.ClassLoader.loadClassInternal(ClassLoade
    ... 5 more

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Eastern Florida
    Rep Power


    NoClassDefFoundError: org/apache/log4j/Logger
    You need to add the library containing the class in the above message to the classpath for java command to find.

  3. #3
    Join Date
    Jun 2010
    Rep Power


    thanks man..
    I solved that somehow..
    I created a new project in Netbeans..
    and imported libraries and ran the code.
    it is working fine..

    now i do the same thing in my current project(here project means the project we create in netbeans..)

    i import same libraries..
    and do all things as same..
    then there is a new error...

    Exception in thread "main" java.lang.NoSuchMethodError: org.jfree.chart.JFreeChartInfo.setLibraries(Ljava/util/List;)V
    at org.jfree.chart.JFreeChartInfo.<init>(JFreeChart.j ava:1467)
    at org.jfree.chart.JFreeChart.<clinit>(JFreeChart.jav a:187)
    at org.jfree.chart.ChartFactory.createTimeSeriesChart (
    at multiple.TimeSeriesDemo.createChart(TimeSeriesDemo .java:41)
    at multiple.TimeSeriesDemo.<init>( :33)
    at multiple.Main.main(
    Java Result: 1

    i have searches many forums on net but i cant find its solution...

  4. #4
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Rep Power


    Perhaps you have more than one jfreechart jar on your classpath and they have different versions.
    Make sure you use only one jar and that it is the same at compile time and at run time.

Similar Threads

  1. JFreeChart 1.0.11
    By Java Tip in forum Java Software
    Replies: 3
    Last Post: 04-18-2014, 09:27 PM
  2. Jfreechart help
    By shruti in forum AWT / Swing
    Replies: 1
    Last Post: 07-11-2009, 05:16 AM
  3. JfreeChart
    By puk284 in forum Advanced Java
    Replies: 1
    Last Post: 05-12-2009, 05:52 PM
  4. JFreeChart 1.0.8
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 11-27-2007, 09:27 PM
  5. JFreeChart 1.0.5
    By levent in forum Java Software
    Replies: 0
    Last Post: 05-10-2007, 06:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts