清单文件中的行顺序是否重要?
有人试图说服我,当清单文件发生变化时,事情就会破坏
Manifest-Version: 1.0 Class-Path: xxx.jar Main-Class: com.something
至
Manifest-Version: 1.0 Main-Class: com.something Class-Path: xxx.jar
(Main-Class和Class-Path线相反.)
解决方法
不,这两行的顺序无关紧要.
这是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.
…
在内部,清单由HashMap表示,HashMap是无序数据结构.如果你想仔细看看,这是源代码java.util.jar.Manifest.
> http://www.massapi.com/source/jdk1.6.0_17/src/java/util/jar/Manifest.java.html
原文地址:https://www.jb51.cc/java/239856.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。