Error when using LogManager (l4j2) with Java 8 (java.lang.reflect.AnnotatedElement cannot be resolved)

后端 未结 5 752
南旧
南旧 2020-11-22 12:14

I just encountered a strange error when switching the JDK version of a new Project of mine from 7u45 to 8u20. A harmless LogManager declaration at the beginning of my class

5条回答
  •  天涯浪人
    2020-11-22 12:52

    Solution 1:

    Try changing the source level.

    1. Go to Project > Preferences > Java Compiler.
    2. Enable Project specific settings
    3. Set compiler compliance level to 1.4 or below.
    4. Restart

    Solution 2:

    1. Create a new workspace.
    2. Copy project files into the new workspace.
    3. Import project into eclipse and rebuild.

提交回复
热议问题