右键你的项目build path — java build path — libraries 如果有 JRE System library , 双击它就会出现如下图 选择最新的版本,如果没有JRE System library 需要添加