Summary
Add a --validate
option to the jar tool that can be used to validate jar files.
Problem
Malformed jar files can lead to weird compilation and binary/source compatibility problems, for instance due to APIs differing across different version in a multi-release jar file.
While the jdk's jar tool does not produce malformed jar files, a third party tool might, or a jar file might be manually edited after creation.
It is currently not possible to (re-)run validation logic without updating a target jar file as well.
Solution
Add a --validate
option to the jar tool, which can be used to directly run the existing validation logic on a given jar file.
Specification
--validate Validate the contents of the jar archive. This option
will validate that the API exported by a multi-release
jar archive is consistent across all different release
versions.
Furthermore, the error message when a main operation is not specified is updated as well:
- One of options -{ctxuid} must be specified.
+ One of options -{ctxuid} or --validate must be specified.
- csr of
-
JDK-8266835 Add a --validate option to the jar tool
-
- Resolved
-