如图: 解决方法: 右击项目->Build Path->Configure Build Path->Libraries,双击JRE System Library,如果出现红叉,表示没有选择JRE,选中对应的JDK即可。