Syntax error, annotations are only available if source level is 5.0

在安装旧 版本的Myeclipse 或则eclipse,当加载新以前写的代码时候会出现下面的错误
Syntax error, annotations are only available if source level is 5.0

注释版本最低要求5.0以上才可以用
意思是说你的编译版本太低了。可能是你安装的Myeclipse或则eclipse是比较旧的版本。
默认的编译jdk可能就是1.4
可以在  系统设置中进行修改
如图:
Syntax error, annotations are only available if source level is 5.0_第1张图片
修改为5.0以上就可以了(必须有5.0以上的jdk)

你可能感兴趣的:(eclipse,jdk,MyEclipse)