原因 这是代码编译需要的jdk版本和代码jdk版本不一致造成的 解决办法 1.File —>project structure—> project language level 2.1.File —>project structure—> module