On Tue, 17 May 2022 12:47:25 GMT, Adam Sotona <asot...@openjdk.org> wrote:

> ### Problem description
> Minimal jdk image created by jlink with the only jdk.compiler module and its 
> dependencies
> fails to run java source launcher correctly (for example when --source N is 
> specified).
> Failing source launcher is only one the expressions of internal jdk.compiler 
> malfunction, another example is failure to run javac with --release option.
> 
> ### Root cause
> Module jdk.compiler requires zip filesystem (jdk.zipfs module) to parse 
> ct.sym file and so to provide full functionality.
> Module jdk.zipfs is not included in the minimal JDK image, because module 
> jdk.compiler does not declare it as "requires" in its module info.
> 
> ### Alternative patch
> The problem can be alternatively resolved by complex code checks in 
> jdk.compiler to provide user with valid error message, however that solution 
> would be just a workaround for jdk.compiler dual functionality (with or 
> without presence of jdk.zipfs module). Compiler functionality without access 
> to ct.sym through jdk.zipfs is very limited. 
> 
> ### Proposed fix
> This patch fixes the problem by explicit declaration of jdk.compiler 
> dependency on jdk.zipfs.
> Plus added specific test case.
> 
> Please review the patch or raise objections against declaration of 
> jdk.compiler dependent on jdk.zipfs.
> 
> Thanks,
> Adam

This pull request has now been integrated.

Changeset: 905bcbe3
Author:    Adam Sotona <asot...@openjdk.org>
URL:       
https://git.openjdk.java.net/jdk/commit/905bcbe34eb9750f6f7f12a577733c71a31d7972
Stats:     76 lines in 3 files changed: 29 ins; 37 del; 10 mod

8286571: java source launcher from a minimal jdk image containing jdk.compiler 
fails with --enable-preview option

Reviewed-by: jlahoda

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

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

Reply via email to