Missing packages

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
jackiewkc
Posts: 5
Joined: Wed Feb 07, 2007 3:47 pm

Missing packages

Post by jackiewkc » Wed Feb 07, 2007 4:05 pm

where can I find the package org.jfree.ui and org.jfree.util ?

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 » Wed Feb 07, 2007 4:09 pm

Those packages are part of JCommon.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

jackiewkc
Posts: 5
Joined: Wed Feb 07, 2007 3:47 pm

Post by jackiewkc » Wed Feb 07, 2007 4:35 pm

Thanks a lot. Now I can compile the file but when I run it, it comes up with the following error.

Exception in thread "main" java.lang.ExceptionInInitializerError
at org.jfree.chart.ChartFactory.createPieChart(ChartFactory.java:242)
at First.main(First.java:17)
Caused by: java.util.MissingResourceException: Can't find bundle for base name org.jfree.chart.resources.JFreeChartResources, locale en_GB
at java.util.ResourceBundle.throwMissingResourceException(Unknown Source)
at java.util.ResourceBundle.getBundleImpl(Unknown Source)
at java.util.ResourceBundle.getBundle(Unknown Source)
at org.jfree.chart.JFreeChartInfo.<init>(JFreeChart.java:1550)
at org.jfree.chart.JFreeChart.<clinit>(JFreeChart.java:230)
... 2 more


Please help.

jackiewkc
Posts: 5
Joined: Wed Feb 07, 2007 3:47 pm

Post by jackiewkc » Wed Feb 07, 2007 4:53 pm

now I fixed the bundle problem and I can run First.java successfully. However I got the following error msg when I ran LineChartDemo1:

F:\Works\Others\jfreechart-1.0.3\source>java LineChartDemo1
Exception in thread "main" java.lang.NoClassDefFoundError: LineChartDemo1 (wrong name: demo/LineChartDemo1)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)

How can I fix it? Thanks

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 » Wed Feb 07, 2007 5:10 pm

You need to spend some time learning about packages, the classpath, and other Java fundamentals, before you start messing around with third party libraries like JFreeChart.

The "problem" here is that LineChartDemo1 is declared to be in the 'demo' package, so it should appear in a 'demo' subdirectory somewhere on your classpath. But you are running it with 'java LineChartDemo1', so it sounds like you compiled it in the top-level directory (you ought to be running it with 'java -classpath {your classpath here} demo.LineChartDemo1'.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

jackiewkc
Posts: 5
Joined: Wed Feb 07, 2007 3:47 pm

Post by jackiewkc » Wed Feb 07, 2007 8:59 pm

i guess i really need to do some more study then :)

but anyway, it works now after I removed the line package demo.

Locked