Error when using LogManager (l4j2) with Java 8 (java.lang.reflect.AnnotatedElement cannot be resolved) -
i encountered strange error when switching jdk version of new project of mine 7u45 8u20. harmless logmanager declaration @ beginning of class being refused following error:
the type java.lang.reflect.annotatedelement cannot resolved. indirectly referenced required .class files
this code:
public class class1 { private static logger log = logmanager.getlogger(class1.class); ...
eclipse proposes me configure build path, have no idea configure because don't know underlying problem of error.
using jdk version 7, works fine.
when using jdk 8 , ide own compiler, eclipse, have update ide version java 8 support, if not using newer java 8 features.
the reason compiler must able load newer class files of jre in order compile software references these classes.
sometimes can away older compiler when ignores newer version number of class files. types confuse older class file parsers use new features, notably annotatedelement
, has default
methods, , map.entry
, interface
has static
methods.
it seems eclipse not make difference between references no class file found , class files failed read when saying “«classname» cannot resolved”.
Comments
Post a Comment