报错信息

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环境变量,不要因为这个就不去配置,重新配置一次环境变量

Logo

一站式 AI 云服务平台

更多推荐