修改你的eclipse指定的JDK版本
在选项里的java compiler中指定版本至少在5.0以上

在Eclipse中改变编译器的方法:Project->Properties->Java Compiler->在右侧设置Enable project specific settings-->JDKCompliance-->Compiler compliance level:1.6;<!--EndFragment-->