eclipse is defaulting to java 1.5 and you have classes implementing interface methods (which in java 1.6 can be annotated with
@override, but in java 1.5 can only be applied to methods overriding a superclass method).
go to your project/ide preferences and set the java compiler level to 1.6 and also make sure you select jre 1.6 to execute your program from eclipse.
this happens when your maven project uses different compiler compliance level and eclipse ide uses different compiler compliance level. in order to fix this we need to change the compiler compliance level of maven project to the level ide uses.
1) to see java compiler compliance level uses in eclipse ide
*) window -> preferences -> compiler -> compiler compliance level : 1.8 (or 1.7, 1.6 ,, ect)
2) to change java compiler compliance level of maven project
*) go to "project" -> "properties" -> select "java compiler" -> change the compiler compliance level : 1.8 (or 1.7, 1.6 ,, ect)
in my case, none the solutions above works. i have to checkout my source code to another folder. from eclipse select file > switch workspaces > other... and then import code to the new workspaces. it works after that.
fixing must override a super class method error is not difficult, you just need to change java source version to 1.6 because from java 1.6 @override annotation can be used along with interface method. in order to change source version to 1.6 follow below steps :
- select project , right click , properties
- select java compiler and check the check box "enable project specific settings"
- now make compiler compliance level to 1.6
- apply changes
this is my second time encounter this problem. first time according the alphazero's recommendation it worked. but in the second time i set to 1.6 it don't work it just like 'cache' this error after clean and rebuild.
try to switch off 'build automatically' as rollin_s said -> error still here!
so i removed the problem project (already set to 1.6) from package explorer and import it again -> it start a rebuild and no error this time
hope this help someone
in my case this problem happened when i imported a maven project into eclipse. to solve this, i added the following in
then in the context menu of the project, go to "maven -> update project ...", and press ok.
that's it. hope this helps.
guys in my case none of the solutions above worked.
i had to delete the files within the project workspace:
and the folder:
then i copied the ones from a similar project that was working before. this managed to fix my broken project.
of course do not use this method before trying the previous alternatives!.
if nothing of the above helps, make sure you have a proper "execution environment" selected, and not an "alternate jre".
to be found under:
project -> build path -> libraries
jre system library and click
if "alternate jre ..." is selected, change it to a fitting "execution environment" like
javase-1.8 (jre1.8.0_60). no idea why, but this will solve it.
the answer by paul worked for me partially. i still had one error then. so, in addition to that, i also had to go to properties-> project facets and there set the java version from 1.5 to 1.6.
maybe that helps.
to resolve this issue, go to your project properties -> java compiler -> select compiler compliance level to 1.6-> apply.
in case this happens to anyone else who tried both alphazero and paul's method and still didn't work.
for me, eclipse somehow 'cached' the compile errors even after doing a project > clean...
i had to uncheck project > build automatically, then do a project > clean, and then build again.
also, when in doubt, try restarting eclipse. this can fix a lot of awkward, unexplainable errors.
with eclipse galileo you go to eclipse -> preferences menu item, then select java and compiler in the dialog.
now it still may show compiler compliance level at 1.6, yet you still see this problem. so now select the link "configure project specific settings..." and in there you'll see the project is set to 1.5, now change this to 1.6. you'll need to do this for all affected projects.
this byzantine menu / dialog interface is typical of eclipse's poor ui design.
- 'Must Override a Superclass Method' Errors after importing a project into Eclipse
- Errors after importing Maven project into Eclipse
- Error after importing a project into eclipse
- Errors importing JS project into eclipse
- Problems after Importing an android project from github into Eclipse
- Errors while importing Maven project into Eclipse
- compile successfully in console but errors occur after importing into eclipse
- Facing issue after importing project into eclipse
- I can't use the custom class after importing the jar file into the eclipse project
- Importing Maven project into Eclipse
- Importing a GitHub project into Eclipse
- Importing a Maven project into Eclipse from Git
- Importing JSON into an Eclipse project
- Missing AndroidManifest.xml when importing an old Android project into Eclipse
- How to build and run Maven projects after importing into Eclipse IDE
- Importing a CMake project into Eclipse CDT
- Maven root pom.xml marked as red when importing existing project into eclipse
- Problem importing Android project archives into Eclipse
- Invalid project description when importing project into Eclipse
- Importing existing java dynamic web project into Eclipse
- Programmatically importing an existing project into Eclipse
- Null Pointer Importing Gradle Project Into Eclipse
- missing classes after publish web project into tomcat using eclipse wtp
- Problems importing an Android project into Eclipse
- Importing Existing Android Project into Eclipse
- How to copy projects into workspace of eclipse after importing the project?
- Importing an existing maven Project into Eclipse
- Invalid item in the dependencies list after importing Android project from Eclipse
- Importing an existing Eclipse project into MyEclipse workspace
More Query from same tag
- A way to make Eclipse PyDev play a sound on exception?
- eclipse not displaying time in logcat for galaxy nexus only?
- Auto completion issue in android-studio
- Eclipse "Run" Not finding the class
- Eclipse won't debug on ASUS eee TF101
- java code templates eclipse
- How can I remove hibernate core jar from build path
- Eclipse + CDT: How to batch build several build configurations
- "Only SunJSSE TrustManagers may be used" when debugging in Eclipse
- Why won't eclipse oxygen start (for the first time)?
- Getting error while JDBC connection with mySql(mysql 5.7.22) through eclipse in ubuntu 18.04
- Android: The type java.lang.Enum cannot be resolved
- Trouble reading BufferedImage
- Android app shows screen before LoginActivity
- Spring Data (JPA) context config XML - jpa:repositories
- Eclipse - Can't change background color after I applied a theme
- Eclipse Autogenerate Project Structure
- pom.xml got undefined version of dependency in opendaylight controller dsbenchmark
- Android App from Library project loading two app icons
- Latest update to Android SDK has made my x86 AVD unusably slow to load .apk
- Cannot edit main.xml in Eclipse Android project
- Paint Component not working outside of Eclipse
- compiler errors when starting gwt:compile with gwt-maven-plugin
- Android:Error an Exclamation mark in my project how to resolve it
- Can't install winrun4j eclipse plugin
- Error implementing methods into button listener
- Java SOAP client throwing exception "Call to a member function setValue() on a non-object"
- Eclipse projects deleted from workspace after checkout to another directory
- Concat stack of lines from text file in a single line
- create new template like toString() in eclipse