zoukankan      html  css  js  c++  java
  • 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.
  • 相关阅读:
    设计模式03-工厂方法
    设计模式02-抽象工厂
    设计模式01-什么是设计模式
    工作流activiti-03数据查询(流程定义 流程实例 代办任务) 以及个人小练习
    工作流activiti-02事物控制、流程引擎创建
    工作流activiti-01个人小结
    jQuery.extend 函数详解
    hibernate框架学习之数据查询(QBC)
    hibernate框架学习之多表查询helloworld
    hibernate框架学习之数据查询(HQL)helloworld
  • 原文地址:https://www.cnblogs.com/lusufei/p/7241163.html
Copyright © 2011-2022 走看看