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

Cannot find annotation method 'value()' in type 'Profile+Annotation'

XMLWordPrintable

    • b13
    • generic
    • generic
    • Verified

      ADDITIONAL SYSTEM INFORMATION :
      javac full version "11-ea+25"
      Windows 10 Version 1803

      A DESCRIPTION OF THE PROBLEM :
      When invoking javac with "--release 9 -Xlint:all", cryptic warning messages are printed. For "10", the same is true. With "8" and "11", the warning messages are not printed.

      If "-Werror" is used, this fails the compilation, but the warning messages give no clue about what causes them, nor how to resolve them.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      * save the source code to a Test.java
      * run javac.exe Test.java --release 9 -Xlint:all

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      No output
      ACTUAL -
      /879A/java/lang/management/OperatingSystemMXBean.sig: warning: Cannot find annotation method 'value()' in type 'Profile+Annotation': class file for jdk.Profile+Annotation not found
      /879A/java/lang/management/PlatformManagedObject.sig: warning: Cannot find annotation method 'value()' in type 'Profile+Annotation'
      /879/java/lang/management/RuntimeMXBean.sig: warning: Cannot find annotation method 'value()' in type 'Profile+Annotation'
      /879A/java/lang/management/MemoryMXBean.sig: warning: Cannot find annotation method 'value()' in type 'Profile+Annotation'
      /879/java/lang/management/ThreadMXBean.sig: warning: Cannot find annotation method 'value()' in type 'Profile+Annotation'
      /8769A/javax/script/ScriptEngineFactory.sig: warning: Cannot find annotation method 'value()' in type 'Profile+Annotation': class file for jdk.Profile+Annotation not found
      6 warnings

      ---------- BEGIN SOURCE ----------
      import java.lang.management.ManagementFactory;
      import java.util.Arrays;
      import javax.script.ScriptEngineManager;

      public class Test {

          public static void main(String[] args) {
              System.out.println(ManagementFactory.getOperatingSystemMXBean().getName());
              System.out.println(ManagementFactory.getRuntimeMXBean().getUptime());
              System.out.println(ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed());
              System.out.println(ManagementFactory.getMemoryMXBean().getNonHeapMemoryUsage().getUsed());
              System.out.println(Arrays.toString(ManagementFactory.getThreadMXBean().findDeadlockedThreads()));

              new ScriptEngineManager().getEngineFactories().stream().forEach(System.out::println);
          }

      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Don't use "-Werror", or use another release, e.g. 8 or 11

      FREQUENCY : always


            jlahoda Jan Lahoda
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: