Bug 54762 - Java 5 fails to run jar file with manifest attribute used
Summary: Java 5 fails to run jar file with manifest attribute used
Status: RESOLVED FIXED
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.9.0
Hardware: PC Linux
: P2 blocker with 1 vote (vote)
Target Milestone: 1.9.1
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-28 20:24 UTC by initialzero
Modified: 2013-03-31 11:25 UTC (History)
0 users



Attachments
Use Java 5 to run this ant file for a demonstration (1.13 KB, text/xml)
2013-03-28 20:24 UTC, initialzero
Details

Note You need to log in before you can comment on or make changes to this bug.
Description initialzero 2013-03-28 20:24:04 UTC
Created attachment 30113 [details]
Use Java 5 to run this ant file for a demonstration

Using ant 1.9.0 jar Java 5 fails to execute a jar file with the manifest attribute. Note: The generated jar works with Java 6 and 7.

The problem is demonstrated when the manifest attribute is used with the jar task.

I have attached a sample ant build.xml file to be used with Java 5 to view the failure.
Comment 1 initialzero 2013-03-28 20:27:54 UTC
The output using Java 5 is "Invalid or corrupt jarfile"
Comment 2 Stefan Bodewig 2013-03-31 06:53:17 UTC
In addition you said on the mailing list, the problem went away if you used a nested manifest element inside the jar task instead, right?

I'll look into it but may need your help testing it since I don't have any Java5 around anymore.
Comment 3 Stefan Bodewig 2013-03-31 07:31:06 UTC
I have created AntUnit tests from your example - ine using a separate file and ine using a nested manifest - we'll see how they fare on our build matrix.

I've compared the created jars byte by byte and the only difference is the timestamps.  Right now I suspect Java5 cannot deal with the Zip64 extra field Ant 1.9 now adds, but then it should fail with nested manifest elements as well.
Comment 4 Stefan Bodewig 2013-03-31 11:03:43 UTC
OK, both testcases fail in Jenkins, I'll add an option to completely turn of
zip64 extensions and make turn it on in <jar> by default.
Comment 5 Stefan Bodewig 2013-03-31 11:25:43 UTC
seems to be fixed with svn revision 1462911