Prior to JDK 9, javac set the 'static' modifier on anonymous classes declared in a static context, e.g., in static methods or static initialization blocks. This contradicts the Java Language Specification, which states that anonymous classes are never static. In JDK 9, javac does not mark anonymous classes 'static', whether they are declared in a static context or not.