如何在清除文件中设置类路径,同时从eclipse创建JAR? [英] How to set classpath in manifest file , while creating JAR from eclipse?

查看:119
本文介绍了如何在清除文件中设置类路径,同时从eclipse创建JAR?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 我正在尝试通过eclipse创建JAR文件。我从

stackoverflow以及其他论坛中读取了一些主题。但没有任何帮助。



我创建了一个单独的清单文件,如下所示。

 清单 - 版本:1.0 
Main-Class:Main
Class-Path:gnujaxp.jar iText-2.1.5.jar jcalendar.jar jcommon-1.0.16.jar jfreechart-1.0.13.jar jfreechart -1.0.13-experimental.jar jfreechart-1.0.13-swt.jar junit.jar servlet.jar swtgraphics2d.jar tinyos.jar

我把所有这些罐放在同一个项目文件夹中。



导出时我正在导出所有资源(也就是这个jar文件。)



但我仍然在当我的应用程序尝试加载包含的任何一个jar时,noclassdeffound错误。



我错在任何地方..



提前致谢。

解决方案

如果您正在使用eclipse> = 3.4尝试export as runnable jar file,它应该正确生成它。



<另外,您可以在导出为jar对话框中提供自己的清单文件。


I am trying to creat JAR file through eclipse. I read some of the threads from

stackoverflow as well as other forums. But nothing is helping.

I have created a separate manifest file like this one.

Manifest-Version: 1.0
Main-Class: Main
Class-Path: gnujaxp.jar iText-2.1.5.jar jcalendar.jar jcommon-1.0.16.jar jfreechart-1.0.13.jar jfreechart-1.0.13-experimental.jar jfreechart-1.0.13-swt.jar junit.jar servlet.jar swtgraphics2d.jar tinyos.jar

I have put all this jars in same project folder.

While exporting i am exporting all resources (meants this jar files also.)

But still i am getting noclassdeffound error when my application tries to load any one of the jar included.

M i wrong anywhere ..

Thanks in advance.

解决方案

If you are using eclipse >=3.4 try "export as runnable jar file" it should generate it correctly.

Otherwhise you can provide your own manifest file in the export as jar dialog.

这篇关于如何在清除文件中设置类路径,同时从eclipse创建JAR?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆