No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? ide

Posted jekaysnow

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? ide相关的知识,希望对你有一定的参考价值。

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 FilesJavajdk1.8.0_181injavac.exe(你的安装路径)
                        </executable>
                   </configuration>
       </plugin>


























以上是关于No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? ide的主要内容,如果未能解决你的问题,请参考以下文章

关于Maven项目build时出现No compiler is provided in this environment的处理

No compiler is provided in this environment. Perhaps you are running on a JRE rather than a...

Maven项目 报错No compiler is provided in this environment. Perhaps you are running on a JRE rather than

mavenmaven的web项目打包报错:No compiler is provided in this environment. Perhaps you are running on a JRE(代

No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK(示

No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK