Syntax error, annotations are only available if source level is 1.5 .

Syntax error,annotations are only available if source level is 5.0
解决办法:Project->Properties->Java Compiler->Compiler Compliance Level选择5.0或者以上的jdk版本

菜单条 ---"Windows" ----"preferneces"
在弹出对话框中 ,在左侧列表框中 选择 "JAVA" ---子菜单中 "compiler" ...
然后在右侧把 "Compiler compliance level" 设置成5.0以上 即可。

你设置好以后   刷新下   工程目录右键有个刷新

猜你喜欢

转载自gwm.iteye.com/blog/1825901