Regression in JDK8 build 78: javac complains about missing Class#isAnnotationPresent

Uwe Schindler uschindler at
Thu Feb 28 13:07:13 PST 2013


we tried to build Apache Lucene with JDK8 b78  today (Java(TM) SE Runtime Environment (build 1.8.0-ea-b78)), so we can use the new features of e.g. doclint on javac and javadocs (see related mails on javadoc-dev at Unfortunately those bugs are fixed, but suddenly, the source code of Apache Lucene and Apache Solr no longer compiles, although valid in JDK6, JDK7 and earlier JDK8 builds. We get the following error:

    [javac] Compiling 113 source files to C:\Users\Uwe Schindler\Projects\lucene\trunk-lusolr3\lucene\build\test-framework\classes\java
    [javac] C:\Users\Uwe Schindler\Projects\lucene\trunk-lusolr3\lucene\test-framework\src\java\org\apache\lucene\util\ error: cannot find symbol
    [javac]     if (targetClass.isAnnotationPresent(SuppressCodecs.class)) {
    [javac]                    ^
    [javac]   symbol:   method isAnnotationPresent(Class<SuppressCodecs>)
    [javac]   location: variable targetClass of type Class<?>
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] 1 error

This method exists since Java 5, but a recent commit in JDK 8 ( seems to cause this. The implementations were removed from the concrete classes, only the new default implementation on the interface should be used. Unfortunately, the compiler (javac) does not understand this and fails to compile. -target and -source is 1.6.

>From the javadocs issues I know that currently the response times on new bugs on is > 3 weeks, so I contact you directly.

Please include my eMail address into the responses, as I am not subscribed to both lists,


Uwe Schindler
uschindler at 
Apache Lucene PMC Member / Committer
Bremen, Germany

More information about the lambda-dev mailing list