Eclipse报错 : String cannot be resolved to a type

#Eclipse报错 : String cannot be resolved to a type

解决问题

MyEclipse导入项目后,java 类总是报出很多红叉错误,如String cannot be resolved to a type 都出来了,开始以为是Myeclipse的事,但重启后发现问题还存在,于是在网上搜,结果说是JDK的问题。

解决方法:

1.右键项目: properties–java build path- Libraries。

2.找到JRE System Library, 发现 JRE System Library 1.8 后面是unbond 。

3.点击edit ,alternate jre 选择JDK的安装路径. 这样, 问题就解决。

图片:
Eclipse报错 : String cannot be resolved to a type

带尺寸的图片: Eclipse报错 : String cannot be resolved to a type
![Alt]Eclipse报错 : String cannot be resolved to a type
(https://imgconvert.csdnimg.cn/aHR0cHM6Ly9hdmF0YXIuY3Nkbi5uZXQvNy83L0IvMV9yYWxmX2h4MTYzY29tLmpwZw =30x30)

居中的图片: Eclipse报错 : String cannot be resolved to a type

居中并且带尺寸的图片: Eclipse报错 : String cannot be resolved to a type