Maven错误:[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather...

错误:

[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

解决方法:

1、如果是Eclipse时,应该是安装好JDK后Eclipse默认使用的是JRE,所以只要调节回来即可。

两种方式都可行:

②、

2、如果一个Maven项目导入Eclipse之后,而上面又没有设置成JDK的路径时,此时也会出现如上错误,那么解决方法就是把Eclipse自动生成的文件全部删除,只保留远程Maven的目录结构。

3、还可以直接针对插件制定版本,比如在POM上增加如下插件的配置:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.1</version>
    <configuration>
        <fork>true</fork>
        <executable>D:\Java\jdk1.7.0_17\bin\javac.exe</executable>
    </configuration>
</plugin>

不过不建议使用这种方法,版本和路径不容易在每台机器上控制。

 

参考:

https://stackoverflow.com/questions/19655184/no-compiler-is-provided-in-this-environment-perhaps-you-are-running-on-a-jre-ra

http://blog.csdn.net/fox_lht/article/details/16369147

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值