Java compiler level does not match 问题解决

来源:互联网 发布:网络口碑维护 编辑:程序博客网 时间:2024/05/08 09:28

       导入一个新的项目,可能会出现Java compiler level does not match  错误,这是因为eclipse和该项目的JDK编译版本不同导致的。


1,首先查看eclipse的jdk编译版本


2,搜索compile,设置编译出的文件使用的格式是JDK1.7



3,进入项目,把项目--prorerties--Java compile,把项目的编译版本设置为1.7。


4,最后,还是进入项目--properties--project Facets,将java 设置为1.7。

 

5,当设置完这些后,项目如果又报错(我的情况如下)

Description ResourcePathLocationType
Access restriction: The type UtilSystemException is not accessible due to restriction on required library C:\Program Files\Java\jre7\lib\rt.jar


1)此时,右键选中项目--build path--configure build path --Java build path ,把JRE system Libarary 选中Remove掉


2)重新 右键选中项目--build path--add  Library  如图即可



0 0
原创粉丝点击