idea 使用mvn install报错No compiler is provided in this environment

在使用IntelliJ IDEA进行Maven项目构建时遇到'No compiler is provided in this environment'错误,原因是运行环境缺少编译器。解决方法是在pom.xml文件中添加相关配置,并在IDEA的内置Terminal中执行`mvn install`,随后显示build成功。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

[ERROR] No compiler is provided in this environment. Perhaps you are running
jdk rather than jre

解决方法:在pom.xml中加入

<build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
    </plugins>
  </build>

运行idea左下角的Terminal输入mvn-install 结果build success.

[ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? [INFO] 1 error [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary for JEECG BOOT 3.7.3 3.7.3: [INFO] [INFO] JEECG BOOT 3.7.3 ................................... SUCCESS [ 5.688 s] [INFO] jeecg-boot-base-core ............................... FAILURE [03:04 min] [INFO] jeecg-module-demo .................................. SKIPPED [INFO] jeecg-module-system ................................ SKIPPED [INFO] jeecg-system-api ................................... SKIPPED [INFO] jeecg-system-local-api ............................. SKIPPED [INFO] jeecg-system-cloud-api ............................. SKIPPED [INFO] jeecg-system-biz ................................... SKIPPED [INFO] jeecg-system-start ................................. SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 03:25 min [INFO] Finished at: 2025-03-11T19:53:35+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compile) on project jeecg-boot-base-core: Compilation failure [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? [ERROR] [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki
03-12
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值