Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDK 9+ probing is incorrect when toolchains are used. #94

Open
pdudits opened this issue Dec 10, 2021 · 0 comments
Open

JDK 9+ probing is incorrect when toolchains are used. #94

pdudits opened this issue Dec 10, 2021 · 0 comments

Comments

@pdudits
Copy link

pdudits commented Dec 10, 2021

When toolchains are used in the build, then java version the plugin is running in and java version it would actually execute may differ.

However, the probe for JDK 9+ is done in-process:

private boolean isModular() {
try
{
Class<?> moduleClass = Class.forName( "java.lang.Module" );
return moduleClass != null;
}
catch ( ClassNotFoundException e )
{
return false;
}
}

Therefore when maven runs JDK 8 and toolchains JDK is JDK 11, plugin will fail with

-Xbootclasspath/p is no longer a supported option.

Because decision to include the argument was made inside JDK 8 VM and then JDK 11 was launched.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant