Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin(自测问题解决!)

在使用maven进行springboot项目打包时,报了Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compile) on project education: Fatal error compiling。搜了很多种方式,后来发现是maven里面指定的jdk版本冲突。下面是解决办法。

1.查看springboot项目中指定的jdk版本

2.查看这个项目使用的maven配置文件的位置

3.打开改settings文件,修改为springboot项目指定的jdk版本保存即可

也可以直接在pom文件中引入jdk版本即可

csharp 复制代码
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
                <source>${java.version}</source>
                <target>${java.version}</target>
            </configuration>
        </plugin>
    </plugins>
</build>
相关推荐
Leinwin1 小时前
OpenClaw 多 Agent 协作框架的并发限制与企业化规避方案痛点直击
java·运维·数据库
薛定谔的悦1 小时前
MQTT通信协议业务层实现的完整开发流程
java·后端·mqtt·struts
enjoy嚣士2 小时前
springboot之Exel工具类
java·spring boot·后端·easyexcel·excel工具类
罗超驿2 小时前
独立实现双向链表_LinkedList
java·数据结构·链表·linkedlist
盐水冰3 小时前
【烘焙坊项目】后端搭建(12) - 订单状态定时处理,来单提醒和顾客催单
java·后端·学习
凸头3 小时前
CompletableFuture 与 Future 对比与实战示例
java·开发语言
wuqingshun3141593 小时前
线程安全需要保证几个基本特征
java·开发语言·jvm
努力也学不会java3 小时前
【缓存算法】一篇文章带你彻底搞懂面试高频题LRU/LFU
java·数据结构·人工智能·算法·缓存·面试
攒了一袋星辰3 小时前
高并发强一致性顺序号生成系统 -- SequenceGenerator
java·数据库·mysql
小涛不学习4 小时前
Spring Boot 详解(从入门到原理)
java·spring boot·后端