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

JDK从11降级到8后IntelliJ IDEA无法运行Spring Boot Maven项目如何解决

解决方案:IntelliJ IDEA中Spring Boot Maven项目JDK11降级JDK8运行失败
  • 修正Maven pom.xml全局编译配置
    在pom.xml中添加/更新properties节点,指定编译版本为JDK8:
<properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

如果项目单独配置了maven-compiler-plugin插件,同步更新插件配置:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.8.1</version>
    <configuration>
        <source>1.8</source>
        <target>1.8</target>
    </configuration>
</plugin>
  • 校验Spring Boot版本兼容性
    Spring Boot 3.0及以上版本最低要求JDK17,完全不支持JDK8,如果原项目使用3.x版本,需将Spring Boot版本降级到2.7.x系列及以下的兼容JDK8的版本。
  • 清理缓存重新构建
  1. 点击IDEA顶部菜单栏 File -> Invalidate Caches...
  2. 勾选清除文件系统缓存选项,执行失效并重启
  3. 重启后执行Maven clean 命令,再执行 install 命令重新构建项目
  • 检查启动运行配置
    打开IDEA右上角运行配置编辑页,找到对应Spring Boot启动项,确认运行使用的JRE版本为1.8。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.10.14 09:57:10