29、关于Maven打包异常的解决方案

情况一:打包异常提示:No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? 

<plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.1</version>
    <configuration>
        <fork>true</fork>
        <executable>
            C:\Program Files\Java\jdk1.8.0_131\bin\javac.exe
        </executable>
    </configuration>
</plugin>

【注意】将上面的代码,加入到pom.xml中的<plugins>节点下,其中值得注意的是<executable>节点下的路径,要改为真实的Java JDK 安装路径

猜你喜欢

转载自blog.csdn.net/crystalcs2010/article/details/88867068