eclipse,import,导入项目显示红色叹号

【场景】eclipse导入项目后,该项目出现红色叹号。打开类文件,会有无数的“The type ... cannot be resolved.”等稀奇古怪的编译错误。

【分析】当前eclipse环境中找不到项目引用的类库。

【解决】重新引用类库,JRE System Library也会出此错误,重新引用即可。

以JRE System Library为例:

1、项目上右键快捷菜单,Build Path -> Configure Build Path

2、Java Build Path,Libraries

3、有红叉的库都Remove,在此移除有红叉的JRE System Library

4、重新添加JRE System Library,单击按钮Add Library

5、JRE System Library,Next

6、在此可直接Finish,也可选Alternate JRE后Finish

7、OK

原文地址:https://www.cnblogs.com/godwithus/p/6380197.html