problems executing compiled code

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

problems executing compiled code

Post by vik » Mon Aug 12, 2002 8:42 am

I've been recompiling the JFreeChart code (I've tried both with ant, and using javac on the command-line), and when ever I try to execute the JFreeChartDemo class (or any other demo) I get the following error:

Exception in thread "main" java.lang.ExceptionInInitializerError
at com.jrefinery.chart.demo.JFreeChartDemo.<init>(Unknown Source)
at com.jrefinery.chart.demo.JFreeChartDemo.main(Unknown Source)
Caused by: java.lang.NullPointerException
at javax.swing.ImageIcon.<init>(ImageIcon.java:138)
at com.jrefinery.chart.JFreeChartInfo.<init>(Unknown Source)
at com.jrefinery.chart.JFreeChart.<clinit>(Unknown Source)
... 2 more

This happens irrespective of whether I use my newly compiled jars in the classpath, or use the root source directory as the classpath (jcommon is in the classpath regardless)

any ideas?

vik

Re: problems executing compiled code

Post by vik » Mon Aug 12, 2002 8:43 am

I forgot to mention, I'm using java 1.4.0 from sun, on a debian linux system

David Gilbert

Re: problems executing compiled code

Post by David Gilbert » Mon Aug 12, 2002 9:35 am

Hi Vik,

The JFreeChartInfo class contains all the information for the "About" dialog displayed in the demo application, including the image of the gorilla (gorilla.jpg). This image gets loaded immediately, irrespective of whether or not it ever gets displayed...I already promised someone else that I would change this to use a "lazy" loading scheme. But for now, you should be able to just add the gorilla.jpg file to your jar file and you should be OK.

Regards,

DG.

vik

Re: problems executing compiled code

Post by vik » Mon Aug 12, 2002 9:40 am

yeah - just discovered that a little while ago, added it to the jar but it still didn't work; the gorilla.jpg file has been moved in CVS to the demo directory; it seems to require it to be in the chart directory.

cheers

vik

(can stop tearing out my hair now ;)

vik

Re: problems executing compiled code

Post by vik » Mon Aug 12, 2002 10:46 am

I modified JFreeChart.java not to set the logo if the file does not exist; this is now in CVS.

Along with this, the gorilla should prolly included in the ant configuration.

vik

Locked