简体   繁体   中英

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:

运行时错误

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的库项目

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.

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.

This has nothing to do with os i belive.You dont have all the necessery libs within your jar.Try to open a jar and see if you have them in.Fact that you are able to run it on your maschine only proves that.Make executable jar with eclipse or whathever you use.And when it ask you for libs check - Extract required libraries into generated Jar.

if you dont know how to get to that point

File>Export>Java>Runnable Jar File> Runnable JAR File Specification.

Also right click on your project and check Your build path.

RightClick project>Properties>Java Build Path>Libraries

Make sure you have everything correct

EDIT-

As i see you use NetBeans im not sure exactly how to find all this there.Bud it will be very similiar.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM