操作方法
右击你的项目文件->Properties->java Build Path->Libraries,会发现其中JRE System Library[javase-1.8] (unbound)红字显示的。
双击它(JRE...),然后会弹出Edit Library->Alternate JRE:java/jar。单击Installed JREs...->Preferences(Filtered)->Search,查询你安装的jdk文件夹路径,选中jdk文件夹就行了,它会自动搜索jre。然后添加在Installed JREs:中。
单击OK,返回到Edit Library中,在Alternate JRE更改后面的列表框,随便选哪个,然后Finish,然后OK。即可解决!