1、window—preferences–java–installed JRES 2、点击jdk选中Edit
3、选中带有rt.jar的文件,然后点击source attachment 4、最后
5、点击完成并应用