Internal compiler error: Classcast exception

user837593 picture user837593 · May 16, 2019 · Viewed 10.7k times · Source

I am getting below error at the start of java file right at letter 'p' of package

Internal compiler error: java.lang.ClassCastException: org.eclipse.jdt.internal.compiler.lookup.MethodBinding cannot be cast to org.eclipse.jdt.internal.compiler.lookup.FieldBinding at org.eclipse.jdt.internal.compiler.ast.ASTNode.resolveAnnotations(ASTNode.java:817)

Project compiles fine from command prompt. but eclipse is showing this error.I am using jdk 8. any help is highly appreciated

I tried restarting eclipse, cleaning project, installing different versions of eclipse etc.

Answer

dansomething picture dansomething · May 20, 2019

I had a similar issue. It turned out to be a compatibility issue between Lombok 1.18.8 and Eclipse 4.11. I reverted to Lombok 1.18.2 to get it working again. The Eclipse ticket that was closed recommends using Lombok 1.16.18. https://bugs.eclipse.org/bugs/show_bug.cgi?id=547244