Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
448 views
in Technique[技术] by (71.8m points)

manifest.mf is overwritten by eclipse during jar export

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: .

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

"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."

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

Using existing manifest http://img46.imageshack.us/img46/6752/export.png


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...