右击项目—Properties—Java Buile Path —选中Libraries—选择Add Library—选中JRE System Library —Next—Finish—OK 返回工程则不再报错了