RFC: Add a --validate option to the jar tool

Jorn Vernee jorn.vernee at oracle.com
Wed May 12 10:58:31 UTC 2021


Hi,

I see that the jar tool has validation logic for multi-release jars that 
is triggered when creating or updating a jar that has a versioned file 
as an input. I wanted to ask what people think about the idea of 
exposing this validation logic directly under a --validate command line 
flag as well.

Malformed multi-release jars can cause compilation and runtime problems 
because the API exposed by the jar is different across different Java 
versions. Exposing the validation logic directly would allow for easy 
validation of jar files that are suspected of being malformed 
multi-release jars.

The validation logic is already cleanly separated into a separate 
Validator class in the source code, and adding a command line flag that 
exposes it directly is a relatively minimal change [1]. It seems like 
maybe the intent in the past was also to expose this validation logic 
directly?

What's the history here? Any opinions about exposing this validation 
logic through a command line option?

Thanks,
Jorn

[1] : https://github.com/openjdk/jdk/pull/3971



More information about the core-libs-dev mailing list