RFR: 8204256: improve jlink error message to report unsupported class file format

Alan Bateman alanb at openjdk.java.net
Wed Sep 30 10:59:05 UTC 2020


On Tue, 29 Sep 2020 19:33:35 GMT, Ian Graves <igraves at openjdk.org> wrote:

> This pull request contains a change to facilitate better error messages in jlink for when jlink creates an image from
> jmod files that are unsupported by the runtime by being _too new_. The existing behavior supports modules that are too
> old via an error about a mismatched version.  The solution to this problem is constrained by jlink's use of some
> specified behavior by java.lang.module.ModuleFinder. The solution in this PR is to subclass some existing exceptions
> internally as to signal to jlink more specific error conditions when attempting to find and open modules.  Bug here:
> https://bugs.openjdk.java.net/browse/JDK-8204256
> New Error message example:
> 
> `Error: jlink encountered a java.base jmod with unsupported module descriptor version 60.0`

This impacts the java.lang.module API. I think I'd prefer to drop all changes to jdk.internal.module from this patch
and instead focus on a jlink specific change.

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

Changes requested by alanb (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/409


More information about the core-libs-dev mailing list