eclipse导入项目会有红叉叉
我这边以导入的是SpringMVC项目为例。下面有很多图片!!!
eclipse导入项目后,jsp页面都是红叉叉  注意: 有一些情况有红叉叉的情况,是因为字符集,要把eclipse默认字符集设为UTF-8
第一步,肯定是先把 jar 包 Build Path

第二步,选择Configure Build Path...
 会跳出这个弹窗,这个时候需要注意JRE System Library 和Server Library。 我这边会显示JRE System Library有叉叉,就需要把它移除,换成自己自带的。  选中它,点击Remove  Remove后,点击Add Library... ,添加自己的jre    此时这边的JRE 就没有叉叉。但是还有一点需要注意,导入的项目里是Tomcat7.0,我自己在eclipse用的是Tomcat9.0,所以这里的ServerLibrary同样要移除,换成我自己的。不然运行程序的时候也会报错。     一般操作完这里jsp页面就不会报错了,如果还有叉叉,就refresh 一下项目。
第三步,这个时候jsp页面不会报错,但是项目名有红叉叉。
 这时候需要找到要导入项目的 .setting 文件夹,打开org.eclipse.wst.common.project.facet.core.xml 文件,删除<runtime name="Apache Tomcat v7.0"/> 这句,保存文件后关闭。    回到eclipse里Refresh 项目即可。  最后,解决问题! 
|