Skip to content

The "-source XX" and "-target XX" java compiler parameters should no longer be used in Ant project #9429

@PetrMiksik

Description

@PetrMiksik

Description

In Ant project, NetBeans is still using obsolete "-source XX" and "-target XX" java compiler parameters. It does not guarantee the compatibility with the target version, because it does not use proper system modules for compilation. The --release XX parameter should be used instead. The compiler warning is clear.

warning: [options] location of system modules is not set in conjunction with -source 11
not setting the location of system modules may lead to class files that cannot run on JDK 11
--release 11 is recommended instead of -source 11 -target 11 because it sets the location of system modules automatically

Use case/motivation

The "--release" parameter cannot be used in Additional compiler option, because it collides with -target and -source parameters.

error: option --source cannot be used together with --release
error: option --target cannot be used together with --release
Usage: javac
use --help for a list of possible options

Related issues

No response

Are you willing to submit a pull request?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:featureA feature requestneeds:triageRequires attention from one of the committers

    Type

    No type
    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