type
status
category
date
slug
summary
tags
icon
Last edited time
May 21, 2023 07:57 AM
报错内容
Error:java: error: release version 5 not supported

报错原因
项目结构或者设置中Java编译器设置错误
解决方法
1、project structure
- 点击
File
Project Structure

- 确保Project下的SDK版本相同

- 确保Modules的Sources中Language level版本与使用的相同

- 确保Modules的Dependencies中Module SDKl版本与使用的相同

2、Preferences
- 点击Preferences(或者Win版中的Setting

- 搜索Java Compiler
- 确保Target byte code version 与所选版本相同

3、重新执行应该已经解决了

4、还有一个问题
每当
pom
文件修改后,原先的设置就没用了,就又报错了,解决方法是
在父pom中的<project>下加maven-compiler-plugin插件,并指定jdk使用的jdk版本