I was getting this error but now it is working.
Solution:
initially JDK compiler was set 1.4 but in my system 1.6 was there. so just i have made JDK compiler 1.6.
Please follow the below steps for correct setting-
Window Menu->Preference ->Compiler->JDK Compiler
Choose the compiler version as you have installed in system
Hope to help you!