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>D:\zongzhimin\Java\jdk1.8.0_144\bin\javac</executable>
</configuration>
</plugin>
</plugins>
</build>
mvn clean package 打包
target目录下生成可执行jar
java -jar 加包名 执行
希望你也只是这个问题引起的。