idea中出现这个原因,试了不是project settings工程选的jdk不对,也不是module用jdk版本不对,而是compiler下java compiler的target bytecode version版本不是1.8. idea截图