DataPackageResources not found.

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Navin Pathuru

DataPackageResources not found.

Post by Navin Pathuru » Fri May 31, 2002 5:22 pm

Hello,
I downloaded yesterday JFreeChart and JCommon and i was able to compile without any problem, but at the time of running when i click on the Display button for the bar charts i got this error :
com.jrefinery.chart.demo.Resources.DataPackageResources not found.

I have looked for that class and it is not there. Can any one help where i can get this class from. Any help is much appreciated.

Regards,
Navin Pathuru

David Gilbert

Re: DataPackageResources not found.

Post by David Gilbert » Fri May 31, 2002 7:15 pm

Hi Navin,

I think you mean com.jrefinery.data.resources.DataPackageResources...the classes are loaded dynamically, so when you compile the demo application, it won't know to compile these classes (they are only referenced indirectly). So you need to invoke javac specifically for these classes.

Regards,

DG

Navin Pathuru

Re: DataPackageResources not found.

Post by Navin Pathuru » Fri May 31, 2002 9:01 pm

Hi David,
Could you please explaing what this means "So you need to invoke javac specifically for these classes. "
Your help is much appreciated.

Regards,
Navin Pathuru

David Gilbert

Re: DataPackageResources not found.

Post by David Gilbert » Fri May 31, 2002 11:16 pm

Hi Navin,

Have a read of section 3.5 of the jfreechart-install.pdf document.

You used to be able to compile all the JFreeChart classes just by running javac (the command line Java compiler included in all JDKs) on the JFreeChartDemo.java source file. This would compile all the classes that JFreeChartDemo depends on.

But now we have resource bundles (just Java classes really) for some European languages...these are not referenced directly in the code, but get loaded by code like this:

// get a locale-specific resource bundle...
String baseResourceClass = "com.jrefinery.chart.demo.resources.DemoResources";
this.resources = ResourceBundle.getBundle(baseResourceClass);

So the compiler doesn't know it has to compile the DemoResources class (in the above example), so you have to compile it explicitly.

Now the instructions in jfreechart-install.pdf are up to date IF you use jcommon.jar. But I have a feeling the instructions for recompiling JCommon have not been updated to mention the com.jrefinery.data.resources package which also needs to be compiled explicitly.

I'll try to remember to update the instructions when JCommon 0.6.2 is released.

Regards,

DG.

Navin Pathuru

Re: DataPackageResources not found.

Post by Navin Pathuru » Sun Jun 02, 2002 10:30 pm

Thanks David. This is resolved. I was looking at a wrong place for the class DataPackResource.

Thank you,
Navin Pathuru

Locked