Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8310061 Note if implicit annotation processing is being used
  3. JDK-8314833

Release Note: `javac` Message If Implicit Annotation Processors Are Being Used

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Delivered
    • Icon: P4 P4
    • 21
    • 21
    • tools

      Annotation processing by `javac` is enabled by default, including when no annotation processing configuration options are present. Implicit annotation processing by default may be disabled in a future release, possibly as early as JDK 22. To alert `javac` users of this possibility, in JDK 21 `javac` prints a note if implicit annotation processing is being used. The text of the note is:

      ```
           Annotation processing is enabled because one or more processors were
          found on the class path. A future release of javac may disable
          annotation processing unless at least one processor is specified by
          name (-processor), or a search path is specified (--processor-path,
          --processor-module-path), or annotation processing is enabled
          explicitly (-proc:only, -proc:full).
          Use -Xlint:-options to suppress this message.
          Use -proc:none to disable annotation processing.
      ```

       Good build hygiene includes explicitly configuring annotation processing. To ease the transition to a different default policy in the future, the new-in-JDK-21 `-proc:full javac` option requests the current default behavior of looking for annotation processors on the class path.

            darcy Joe Darcy
            darcy Joe Darcy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: