In this blog post I am going to explain the source of the problem and how to fix it.
You might receive an error like this:
The method onClick(View) of type new View.OnClickListener(){} must override a superclass method Java Problem
The Source of the Problem: The project was written with a Java JDK Compiler compliance level of 1.6 but your eclipse setting is 1.5.
How to fix the problem:
Right click on your project and select "properties"
Select "Java Compiler"
Make sure "Enable project specific settings" is checked
Change the "Compiler compliance level:" to 1.6
Save the changes.
Now select "Project" > "Clean..."
Your project should now build without any errors.

48 comments:
thanks a lot for this post, saved me some time.
Great thanks.
Thank you!
Thank you so much, you saved my life!
Hi what is the style of your eclipse and how can i get it?
I created it. I also am sharing it. Here is my blog post about my dark color theme and a link to download the import file.
http://androidcodemonkey.blogspot.com/2011/04/eclipse-dark-color-theme.html
Excellent help
I LOVE YOU
Thank you! Have been looking all over for this. Was kinda hard to find :)
Excellent
Thank you
Nice thank you....
Thank you. This helped me out tremendously.
This is very helpful! Thanks! :D
This saved my ass. Thanx a lot.
Thanks a lot. Saved a lot of time. :-)
Kicked my errors out the front door. Thanks, buddy!
Hello,
Thanks a lot, Its working for me.
Thank you!!! You have saved one more soul today...
saved me a bunch of frustration! Thanks!
Thanx!
Super.......
A lat of thanks
Great! Thanks a lot. Saved a lot of time
Thanks a lot!!!
Thanks! Helped a lot :)
thanks a lot
amazing. thanks. it works now :)
This helped me greatly!
Great Job man ...
Helped me a lot :)
thanks!-angeles jesus
If you set the Compiler to 1.6.and still you get this error. Try to check your imports. Eclipse always try to do this 'import android.content.DialogInterface.OnClickListener' instead of the doing this -> 'import android.view.View.OnClickListener'. That solves my problem.
Thanks - had this exact problem - love the quick fix
Amazingly helpful thank you
Thanks much !!!
Thanks Greg.
THAAAAANNNNKKKKSSSS!!!!!!!!!!!!!!!!
Thanks a lot! :)
Thank's mate!
That saved my laptop from a rather violent punch.
Thanks a ton! Saved me a ton of time!
thanks for the post
Thank you. Thank you very much.
Thanks a lot!
Sorry to be negative but this didn't work for me. Still getting told to remove @Override. Any other suggestions ?
Just found the solution on another site. After setting Compliance Level to 1.6 and BEFORE running Clean, it is essential to uncheck Project > Build Automatically.
Awesome Solution...
Great
Gracias!
Thanks!
Thanks for this nice post. Saved me a lot of time.
Post a Comment