java: 错误: 不支持发行版本 17

 出现版本问题:

 这是版本不匹配问题,需要Java Compiler里面的版本一致

选择File–Setting

再Build,Execution,Deployment—Compiler–java Compiler 

 需要把17改为11

运行后,会出现

org/springframework/boot/SpringApplication has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0

原因是SpringBoot使用了3.0或者3.0以上,Spring官方发布从Spring6以及SprinBoot3.0开始最低支持JDK17,需要将SpringBoot版本降低为3.0以下。

 

刷新Maven,重新启动即可

 

文章出处登录后可见!

已经登录?立即刷新

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
青葱年少的头像青葱年少普通用户
上一篇 2023年12月14日
下一篇 2023年12月14日

相关推荐