java项目显示红叉,程序却没有错误

转 http://blog.sina.com.cn/s/blog_825b7d7c0102w7rq.html

(2016-07-02 11:38:38)
  分类: javaWeb
电脑换了不同版本的Tomcat和JDK后,导入之前的项目出现红叉错误,程序却没有出现错误:
在eclipse的markers标签页下提示2个错误警告:
错误一: Description Resource Path Location Type Java compiler level does not match the version of the installed Java project facet. ******  Unknown  Faceted Project Problem (Java Version Mismatch)
本地资源描述文件中配置的jdk版本和我电脑上安装的版本不匹配。

解决方案:找到项目在本地工作空间目录下的  .settings目录。打开org.eclipse.wst.common.project.facet.core.xml
< ?xml version="1.0" encoding="UTF-8"?>
< ?faceted -project>
< ?runtime name="MyEclipse Tomcat v7.0">
< ?fixed facet="wst.jsdt.web">
< ?fixed facet="java">
< ?fixed facet="jst.web">
< ?installed facet="java" version="1.5">
< ?installed facet="jst.web" version="2.5">
< ?installed facet="jst.web.jstl" version="1.2">
< ?installed facet="web.struts2" version="2.1">
< ?installed facet="wst.jsdt.web" version="1.0">
< \/faceted>
< \/code>

< ?installed facet="java" version="1.5">修改成自己电脑上安装的jdk版本,比如我安装的jdk是jdk1.8.0_91,就修改为

错误二: Description Resource Path Location Type Target runtime MyEclipse Tomcat v7.0 Unknown Faceted Project Problem    本地安装的tomcat版本与项目资源配置文件配置的版本不匹配
解决方案:
找到项目在本地工作空间目录下的  .settings目录。打开org.eclipse.wst.common.project.facet.core.xml
< ?xml version="1.0" encoding="UTF-8"?>
< ?faceted -project>
< ?runtime name="MyEclipse Tomcat v7.0">
< ?fixed facet="wst.jsdt.web">
< ?fixed facet="java">
< ?fixed facet="jst.web">
< ?installed facet="java" version="1.5">
< ?installed facet="jst.web" version="2.5">
< ?installed facet="jst.web.jstl" version="1.2">
< ?installed facet="web.struts2" version="2.1">
< ?installed facet="wst.jsdt.web" version="1.0">
< \/faceted>
< \/code>
将< ?runtime name="MyEclipse Tomcat v7.0">删除,保存后在eclipse中右键项目refresh.

转载于:https://www.cnblogs.com/lusufei/p/7241163.html

你可能感兴趣的:(java,开发工具,runtime)