spring-boot 生成可执行jar包时仍然报错: No compiler is provided in this environment . Perhaps you are running on

本文介绍了一种解决Spring Boot项目在生成可执行jar包时遇到的Nocompilerisprovidedinthisenvironment错误的方法。通过在pom.xml中配置maven-compiler-plugin并指定jdk路径,成功解决了IDEA环境下由于JRE而非JDK导致的问题。

spring-boot 生成可执行jar包时仍然报错: No compiler is provided in this environment . Perhaps you are running on a jre rather than a JDK?

环境变量以及idea配置后仍然报错,百度后找到最终解决方案。亲测可用。

jdk的环境变量,maven的环境变量,eclipse里的jdk配置都正常了,但是使用spring-boot 生成可执行jar包时仍然报错: No compiler is provided in this environment . Perhaps you are running on a jre rather than a JDK?

我是这么解决的:pom中加配置maven-compiler-plugin并指定jdk路径

<build>
   <plugins>
       <plugin>
           <groupId>org.springframework.boot</groupId>
           <artifactId>spring-boot-maven-plugin</artifactId>
       </plugin>
       <plugin>
           <artifactId>maven-compiler-plugin</artifactId>
           <configuration>
               <source>1.8</source>
               <target>1.8</target>
               <fork>true</fork>
               <!-- executable 可指定也可不用 --> 
               <executable>D:\zongzhimin\Java\jdk1.8.0_144\bin\javac</executable>
           </configuration>
       </plugin>
   </plugins>
</build>

作者:zhengjie_yjx
来源:优快云
原文:https://blog.youkuaiyun.com/zhengjie_yjx/article/details/80240462
版权声明:本文为博主原创文章,转载请附上博文链接!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值