简体   繁体   English

JFreeChart Java JAR未在其他计算机上运行

[英]JFreeChart Java JAR not running on a different machine

I have created an application using the JFreeChart library for use on another machine. 我已经使用JFreeChart库创建了一个应用程序,以便在另一台机器上使用。

Previously I have developed applications with JFreeChart (using the same libraries) which has worked fine on other machines. 以前,我使用JFreeChart(使用相同的库)开发了应用程序,该应用程序在其他计算机上运行良好。 The only difference is this machine is running Vista. 唯一的区别是此计算机运行的是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. 但是,找不到的类位于下图中突出显示的jar中,该图显示了我导入的JAR库。 I have also established that this JAR is included in the manifest for the application. 我还确定此JAR已包含在应用程序清单中。 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 开发机器Java版本:1.7.0_45目标机器Java版本:1.7.0_45

Thanks in advance. 提前致谢。

Check the Class-Path attribute in your JAR's manifest, which should contain entries like this: 检查JAR清单中的Class-Path属性,该属性应包含以下条目:

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: 另外,检查NetBeans项目文件夹中的dist/README.TXT ,它应该对项目所需的库说出这样的内容:

To run the project from the command line, go to the dist folder and type the following: 要从命令行运行项目,请转到dist文件夹并键入以下内容:

java -jar "CISOnlineMonitor.jar" 

To distribute this project, zip up the dist folder (including the lib folder) and distribute the ZIP file. 要分发该项目,请压缩dist文件夹(包括lib文件夹)并分发ZIP文件。

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. 我不相信这与操作系统有关。您在jar中没有所有必需的libs。尝试打开一个jar,看看是否有它们。事实证明您可以在机器上运行它只是证明了这一点。带有eclipse或您使用的任何东西的可执行jar。当它要求您提供libs检查时-将所需的库提取到生成的Jar中。

if you dont know how to get to that point 如果你不知道如何达到这一点

File>Export>Java>Runnable Jar File> Runnable JAR File Specification. 文件>导出> Java>可运行的Jar文件>可运行的JAR文件规范。

Also right click on your project and check Your build path. 同样,右键单击您的项目,然后检查您的构建路径。

RightClick project>Properties>Java Build Path>Libraries 右键单击项目>属性> Java构建路径>库

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. 如我所见,您使用NetBeans即时通讯并不确定如何在其中找到所有这些内容。但是非常相似。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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