简体   繁体   English

具有无法识别字段的 Java jar 清单文件

[英]Java jar manifest file with unrecognized fields

I am working on migration my application to java9, I found that I can set Add-Opens in my manifest file to open some java internal packages for reflection usage.我正在将我的应用程序迁移到 java9,我发现我可以在清单文件中设置Add-Opens以打开一些 java 内部包以供反射使用。 I am thinking fields like Add-Opens are only support after java9, so I wonder what will happen if I run it using lower version like java8.我在想像Add-Opens这样的字段仅在 java9 之后才支持,所以我想知道如果我使用 java8 等较低版本运行它会发生什么。 Will those unrecognized fields (general unrecognized fields not specific to Add-Opens ) in the manifest file be ignored in java8? java8中会忽略清单文件中那些无法识别的字段(不是特定于Add-Opens的一般无法识别的字段)吗? What impact they can have on the application when running on java8?在 java8 上运行时,它们会对应用程序产生什么影响? Thank you.谢谢你。

Thanks for VGR's comment, this link for oracle official document on manifest states that Attributes which are not understood are ignored. Such attributes may include implementation specific information used by applications.感谢 VGR 的评论,oracle 官方文档的链接清单指出, Attributes which are not understood are ignored. Such attributes may include implementation specific information used by applications. Attributes which are not understood are ignored. Such attributes may include implementation specific information used by applications.

Reference: https://docs.oracle.com/en/java/javase/18/docs/specs/jar/jar.html#overview参考: https ://docs.oracle.com/en/java/javase/18/docs/specs/jar/jar.html#overview

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM