这个错误我不止遇到一次,所以干脆记录下来解决方法。 解决方法是:File --> Setting --> Java Compiler --> 设置项目的Target bytecode version为8。