在jar导出期间manifest.mf被eclipse覆盖 [英] manifest.mf is overwritten by eclipse during jar export

查看:391
本文介绍了在jar导出期间manifest.mf被eclipse覆盖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用eclipse制作一个可执行的jar归档文件. 因此,在我的项目中,我创建了文件src/META-INF/MANIFEST.MF:

I would like make an executable jar archive with eclipse. So into my project I created file src/META-INF/MANIFEST.MF :


Manifest-Version: 1.0
Main-Class: MainClass
Class-Path: .

但是当我导出我的Java eclipse项目时,eclipse用以下消息警告我:

But when I export my java eclipse project eclipse warn me with following message:

"JAR导出已完成,并显示警告.有关更多信息,请参阅详细信息. 将myproject/src/META-INF/MANIFEST.MF替换为生成的MANIFEST.MF,并且不再包含在JAR中."

"JAR export finished with warnings. See details for additional information. myproject/src/META-INF/MANIFEST.MF was replaced by the generated MANIFEST.MF and is no longer in the JAR."

任何人都知道在Eclipse中导出项目时如何避免这种情况?

Anyone know how I can avoid this when I export my project in eclipse?

推荐答案

在导出jar时,选择使用现有清单的选项并浏览到项目的清单文件.生成的jar现在将具有该清单文件.

While exporting the jar, select the option to use existing manifest and browse to the manifest file of your project. The generated jar will have that manifest file now.

使用现有清单http://img46.imageshack.us/img46/6752/export.png

这篇关于在jar导出期间manifest.mf被eclipse覆盖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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