RFR: 8268611: jar --validate should check targeted classes in MR-JAR files

Christian Stein cstein at openjdk.org
Thu Dec 12 15:32:35 UTC 2024


On Thu, 12 Dec 2024 15:26:20 GMT, Christian Stein <cstein at openjdk.org> wrote:

>> In this context the actual class file major version doesn't add any value to communicate the issue to the user:
>> - `javac --release N` and
>> - `jar --release N` use the "Java release feature number" in their options, so does the
>> - `META-INF/versions/N` path.
>
> User-facing help messages read:
> 
> javac --help
> ...
>   --release <release>
>         Compile for the specified Java SE release.
>         Supported releases:
>             8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25
> 
> 
> jar --help
> ...
>       --release VERSION      Places all following files in a versioned directory
>                              of the jar (i.e. META-INF/versions/VERSION/)

Maybe this reads better? `release version of {0} too high: {1}`:

release version of META-INF/versions/9/version/Version.class too high: 25
release version of META-INF/versions/10/version/Version.class too high: 25

Note that the path of the JAR entry contains the target release version number, and `Version.class` was compiled with `javac` 25 (with `--release 25`).

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/22103#discussion_r1882378353


More information about the compiler-dev mailing list