A discussion forum for JFreeChart (a 2D chart library for the Java platform).
-
danichef
- Posts: 3
- Joined: Mon Mar 04, 2019 1:07 pm
- antibot: No, of course not.
Post
by danichef » Mon Mar 04, 2019 1:14 pm
So it's the first time I use this library and I'm already having trouble and cannot find any solution

When I load the plugin, it throws this error "org.jfree.data.category.CategoryDataset". This is are my dependencies in pom (using IntelliJ and Maven):
Code: Select all
<!-- https://mvnrepository.com/artifact/org.jfree/jcommon -->
<dependency>
<groupId>org.jfree</groupId>
<artifactId>jcommon</artifactId>
<version>1.0.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jdom/jdom -->
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom</artifactId>
<version>2.0.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jfree/jfreechart -->
<dependency>
<groupId>org.jfree</groupId>
<artifactId>jfreechart</artifactId>
<version>1.0.14</version>
</dependency>
<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
</dependency>
Any solution?
-
david.gilbert
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
-
Contact:
Post
by david.gilbert » Tue Mar 05, 2019 9:51 pm
First, please post the exact exception message you see. Second, perhaps try a more recent version of JFreeChart (1.0.14 is quite old).
-
danichef
- Posts: 3
- Joined: Mon Mar 04, 2019 1:07 pm
- antibot: No, of course not.
Post
by danichef » Tue Mar 05, 2019 10:49 pm
Code: Select all
java.lang.NoClassDefFoundError: org/jfree/data/category/CategoryDataset
at com.danichefktn.stats.Stats.onEnable(Stats.java:47) ~[?:?]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_121]
Caused by: java.lang.ClassNotFoundException: org.jfree.data.category.CategoryDataset
at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_121]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_121]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_121]
Tried using a newer version of both jfreechart and jcommon but still get the same error
-
John Matthews
- Posts: 513
- Joined: Wed Sep 12, 2007 3:18 pm
Post
by John Matthews » Thu Mar 07, 2019 3:53 am
For reference, I downloaded the relevant JAR files and verified the presence of
CategoryDataset:
Code: Select all
$ jar tf jfreechart-1.0.14.jar | grep CategoryDataset
org/jfree/data/category/CategoryDataset.class
I then ran
BarChartDemo1, which imports
CategoryDataset:
Code: Select all
$ java -cp jfreechart-1.0.14.jar:jcommon-1.0.17.jar org.jfree.chart.demo.BarChartDemo1
Last edited by
John Matthews on Sun Mar 10, 2019 3:23 pm, edited 1 time in total.
-
danichef
- Posts: 3
- Joined: Mon Mar 04, 2019 1:07 pm
- antibot: No, of course not.
Post
by danichef » Sun Mar 10, 2019 2:15 pm
weird