Java: Unresolved compilation problem

Solution 1:

(rewritten 2015-07-28)

The default behavior of Eclipse when compiling code with errors in it, is to generate byte code throwing the exception you see, allowing the program to be run. This is possible as Eclipse uses its own built-in compiler, instead of javac from the JDK which Apache Maven uses, and which fails the compilation completely for errors. If you use Eclipse on a Maven project which you are also working with using the command line mvn command, this may happen.

The cure is to fix the errors and recompile, before running again.

The setting is marked with a red box in this screendump:

Eclipse Preferences under OS X

Solution 2:

try to clean the eclipse project

Solution 3:

you just try to clean maven by command

mvn clean

and after that following command

mvn eclipse:clean eclipse:eclipse

and rebuild your project....

Solution 4:

Your compiled classes may need to be recompiled from the source with the new jars.

Try running "mvn clean" and then rebuild