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

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

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路径


    
        
            org.springframework.boot
            spring-boot-maven-plugin
        
        
            maven-compiler-plugin
            
                1.8
                1.8
                true                 
                D:\zongzhimin\Java\jdk1.8.0_144\bin\javac
            
        
    

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18

mvn clean package 打包 
target目录下生成可执行jar 
java -jar 加包名 执行

希望你也只是这个问题引起的。

你可能感兴趣的:(spring-boot 生成可执行jar包时仍然报错: No compiler is provided in this environment . Perhaps you are running on)