Internal compiler error: Classcast exception

Try updating lombok to the most recent version (Download 1.18.10). It worked for me.


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


In my case the "Internal compiler error: java.lang.ClassCastException" came from a different version of lombok.jar - one was installed in the eclipse directory as javaagent and the second was in my maven project. After updating the lombok.jar in the eclipse directory anything works fine.

Hope this helps.


I noticed that in my workspace the error only occurs with the classes containing the annotation @JsonProperty. The workaround that I found - comment all these annotations in the class out, save and let the workspace build run. Then uncomment and save, so that the class file returns to its original state. In my case the error disappears until Eclipse compiles the class again. Normally it wouldn't happen as long as the class is not changed.