Java 清单文件中的行顺序
清单文件中的行顺序重要吗?
有人试图说服我,当清单文件从 变为(主类和类路径行颠倒)时,他的事情就会
Manifest-Version: 1.0
Class-Path: xxx.jar
Main-Class: com.something
崩溃
Manifest-Version: 1.0
Main-Class: com.something
Class-Path: xxx.jar
。
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.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,这两行的顺序不重要。
以下是文档的引用:
在内部,清单由
HashMap
表示,它是一种无序数据结构。如果您想仔细查看,这里是源代码java.util.jar.Manifest
。No, the order of those two lines should not matter.
Here's a quote from the documentation:
Internally the manifest is represented by a
HashMap
which is an unordered data structure. Here's the source codejava.util.jar.Manifest
if you wish to have a closer look.