Maven编报错:No compiler is provided in this environment. Perhaps you are running on a JRE rather a JDK?

报错信息

idea报错No compiler is provided in this environment. Perhaps you are running on a JRE rather a JDK?

解决方式

方式1.pom.xml里面配置指定JDK路径

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <fork>true</fork>
          <!--指定你的jdk地址-->
          <executable>
            C:\Program Files\Java\jdk1.8.0_231\bin\javac.exe
          </executable>
        </configuration>
      </plugin>

方式2.检查是否JDK环境变量配置正确。高版本的JDK安装会自动配置JDK环境变量,不要因为这个就不去配置,重新配置一次环境变量(踩坑)

猜你喜欢

转载自blog.csdn.net/qq_38425803/article/details/106908119