首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网络技术 > 网络基础 >

eclipse java jar manifest.mf资料导入第三方jar及could not find the main class

2012-10-28 
eclipse java jar manifest.mf文件导入第三方jar及could not find the main class.?以下是manifest.mf文件

eclipse java jar manifest.mf文件导入第三方jar及could not find the main class.

?

以下是manifest.mf文件的例子:

?

Manifest-Version: 1.0?

Main-Class: FSDemo

Class-Path: lib/hadoop-0.20.2-core.jar lib/commons-logging-1.1.1.jar

?

注意事项:

1.Main-Class必须在Class-Path前面,否则将会被eclipse重写manifest.mf,出现"could not find the main class. program will exit"错误,很奇怪的是重写后manifest.mf文件的Main-Class是在下面的。

?

2.可执行jar导入第三方jar,必须在Class-path中写明,第三方jar放在可执行jar文件的统一文件夹下,通过java -jar命令导入第三方jar是不可行的!

?

3.manifest.mf文件字段名与字段值之间只有一个空格!

?

热点排行