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

javac fails to compile module-info.java when -processor is specified

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not an Issue
    • P4
    • 9
    • 7
    • tools
    • generic
    • generic

    Description

      javac (with the module support) fails to compile module-info.java file when an annotation processor is specified via the -processor option. Without the -processor option, javac successfully compiles that module-info.java file.

      To reproduce:

      // m/module-info.java
      @ImportModules({
          @ImportModule(name="java.se")
      })

      module m;

      $ <JDK>/bin/javac -source 7 -target 7 module-info.java
        - compiled successfully

      $ <JDK>/bin/javac -source 7 -target 7 -processor MyProcessor module-info.java
      initialising...
      module-info.java:1: incompatible types
      found : java.module.annotation.ImportModules
      required: java.lang.annotation.Annotation
      @ImportModules({
       ^
      1 error

      Attached is the MyProcessor.java.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mchung Mandy Chung
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: