码迷,mamicode.com
首页 > 其他好文 > 详细

No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? idea maven 打包报错问题解决

时间:2019-10-22 14:50:55      阅读:104      评论:0      收藏:0      [点我收藏+]

标签:pil   compiler   com   span   路径   strong   maven   dma   题解   

mvn clean install -X -Dmaven.test.skip=true -P dev 打包报错:
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

idea,项目,maven 也设置了统一的jdk,还是报错,

解决方法1:
在maven的setting.xml 文件 <profiles> 标签中加入指定JDK的版本,

<profile>     
      <id>JDK-1.8</id>       
      <activation>       
        <activeByDefault>true</activeByDefault>       
        <jdk>1.8</jdk>       
      </activation>       
      <properties>       
        <maven.compiler.source>1.8</maven.compiler.source>       
        <maven.compiler.target>1.8</maven.compiler.target>       
        <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>       
      </properties>       
    </profile>

解决方法2:

在项目的pom.xml 文件加入maven插件,<plugins>中加入jdk路径

<plugin>
                  <artifactId>maven-compiler-plugin</artifactId>
                  <version>3.1</version>
                  <configuration>
                        <fork>true</fork>
                        <executable>
                            C:\Program Files\Java\jdk1.8.0_181\bin\javac.exe(你的安装路径)
                        </executable>
                   </configuration>
       </plugin>

 

No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? idea maven 打包报错问题解决

标签:pil   compiler   com   span   路径   strong   maven   dma   题解   

原文地址:https://www.cnblogs.com/wpcnblog/p/11719269.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!