Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8317544

Consider disabling the compiler's default active annotation processing

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 22
    • tools
    • None
    • behavioral
    • low
    • Some annotation processing users may have missed the message and be surprised by the new behavior. However, it is easily restored by adding the `-proc:full` command line option, which is also valid in JDK 21.
    • add/remove command in $JDK/bin, add/remove/modify command line option
    • JDK

      Summary

      Stop running annotation processors found on the class path by default. That behavior can still be enabled by using one or more separate options.

      Problem

      Starting in JDK 21, the message printed by JDK-8310061 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.

      This CSR is to implement the future disabling described in the message above.

      Solution

      Without other configuration options, do not search the class path for annotation processors.

      Specification

      No specification changes.

            darcy Joe Darcy
            webbuggrp Webbug Group
            Jonathan Gibbons
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: