my dog learned polymorphism*
The moose likes Java in General and the fly likes jar and MANIFEST.MF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "jar and MANIFEST.MF" Watch "jar and MANIFEST.MF" New topic
Author

jar and MANIFEST.MF

mark I thomas
Ranch Hand

Joined: Apr 07, 2008
Posts: 86
I have a folder that contains all the classes and META-INF. Here is the subfolders

com (includes its subfolders that contain .class files)
META-INF/MANIFEST.MF

I used ant

<jar jarfile="myapp.jar"
basedir="."/>

to create a "myapp.jar" file. The jar was successfully generated. However, when I do

"jar -xvf myapp.jar" to unpack it, I saw the META-INF/ folder and its MANIFEST.MF fiel. The MANIFEST.MF is different from the original MANIFEST.MF I used for packing.

Do you know why and how I can ensure the MANIFESTY.MF is not changed ?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42276
    
  64
The proper way to add a manifest is not to have a file in a META-INF directory, but to specify the file in a manifest attribute. The file can be anywhere and be named anything; Ant will package it properly.

Even better, you can keep the meta information in the build file (if you want):


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jar and MANIFEST.MF