You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

克隆Spring Boot Maven项目报错:JDK版本不兼容及语言级别问题

解决方案

1. 升级JDK到16版本

报错error: release version 16 not supported的核心原因是本地JDK版本(14)低于项目要求的JDK 16。

  • 下载并安装JDK 16
  • 在IntelliJ中配置项目JDK:
    • 打开File > Project Structure(快捷键Ctrl+Alt+Shift+S)
    • 进入Project Settings > Project,将Project SDK切换为JDK 16
    • 等待IntelliJ完成项目设置同步

2. 修复product-service的语言级别配置

针对pom.xml中语言级别无效/缺失的提示,直接在product-service模块的pom.xml中添加或修改maven-compiler-plugin配置:

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
                <source>16</source>
                <target>16</target>
            </configuration>
        </plugin>
    </plugins>
</build>
  • 保存pom.xml后,右键项目选择Maven > Reload Project,让配置生效

3. 验证并启动项目

  • 确认IntelliJ右下角显示的项目JDK为16
  • 找到product-service模块中带有@SpringBootApplication注解的启动类,右键选择Run启动服务

内容的提问来源于stack exchange,提问作者Ghassen

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.18 08:35:23