Does the order of lines in manifest file matter?
Somebody is trying to convince me that things break for him when the manifest file changes from
Manifest-Version: 1.0
Class-Path: xxx.jar
Main-Class: com.something
to
Manifest-Version: 1.0
Main-Class: com.something
Class-Path: xxx.jar
(Main-Class and Class-Path lines are reversed.)
No, the order of those two lines should not matter.
Here's a quote from the documentation:
...
Versions:
Manifest-Version and Signature-Version must be first, and in exactly that case (so that they can be recognized easily as magic strings). Other than that, the order of attributes within a main section is not significant.
Ordering:
The order of individual manifest entries is not significant.
...
Internally the manifest is represented by a HashMap
which is an unordered data structure. Here's the source code java.util.jar.Manifest
if you wish to have a closer look.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With