Skip to content

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

Description

@pdudits

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions