Search code examples
javajfreechartexecutable-jar

JFreeChart Java JAR not running on a different machine


I have created an application using the JFreeChart library for use on another machine.

Previously I have developed applications with JFreeChart (using the same libraries) which has worked fine on other machines. The only difference is this machine is running Vista.

Please see below for the run-time exception I am getting:

run-time-error

The class that cannot be found, however, is located in the highlighted jar in the below image showing my imported libraries for the JAR. I have also established that this JAR is included in the manifest for the application. See below image:

java-libraries-project

So I very much need this to work and have no idea where to look next - or what is causing this problem!

Development machine Java version: 1.7.0_45 Target machine Java version: 1.7.0_45

Thanks in advance.


Solution

  • Check the Class-Path attribute in your JAR's manifest, which should contain entries like this:

    Class-Path: lib/jfreechart-1.0.17.jar lib/jcommon-1.0.21.jar …
    

    Also, examine dist/README.TXT in your NetBeans project folder, which should say something like this regarding libraries required by your project:

    To run the project from the command line, go to the dist folder and type the following:

    java -jar "CISOnlineMonitor.jar" 
    

    To distribute this project, zip up the dist folder (including the lib folder) and distribute the ZIP file.