Manifest.mf is overwritten during jar export

I would like to make jar executable with eclipse. Therefore, in my project, I created the src / META-INF / MANIFEST.MF file:

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

But when I export the java eclipse eclipse project, provide me with the following message:

"The export of the JAR has completed with warnings. For details, see the details. Myproject / src / META-INF / MANIFEST.MF has been replaced by the generated MANIFEST.MF and is no longer in the JAR.

Does anyone know how I can avoid this when I export a project to eclipse?

+6
eclipse jar export executable-jar
source share
2 answers

When exporting the jar, select the option to use the existing manifest and navigate to the manifest file of your project. The generated jar will have this manifest file.

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

+10
source share

Using Oxygen (Release 4.7.0), I was able to do this successfully. The confusing part is that the Next and Finish buttons are activated on the JAR File Specification page of the JAR Export wizard. Therefore, if you do not notice this and just click "Finish", you will receive a warning (and the generated manifest). To use your own, then click Next (once for the JAR packaging options and again for the Manifest JAR specification).

0
source share

All Articles