【Java】IDEA maven 打包出现:No compiler is provided in this environment.

在使用maven打包的时候碰到了这个错误:
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

解决办法:
在pom.xml中的build----》plugins中添加

<plugin>
    <groupId>org.apache.maven.pluginsgroupId>
    <artifactId>maven-compiler-pluginartifactId>
    <configuration>
        <fork>truefork>
        
        <executable>
            D:\Program Files\Java\jdk1.8.0_162\bin\javac.exe
        executable>
    configuration>
plugin>

你可能感兴趣的:(Java)