运行IDEA自带maven错误

如何使用IDEA自带maven

参考:https://blog.csdn.net/sleetdream/article/details/122685104

vim ~/.bash_profile

输入

export IDEA_MAVEN=/Applications/IntelliJ\ IDEA.app/Contents/plugins/maven/lib/maven3
export PATH=$PATH:$IDEA_MAVEN/bin

更新

source ~/.bash_profile

备注:IDEA内使用,也需要source ~/.bash_profile

idea运行mvn报错:No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project jrdw-domains: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

参考:https://blog.csdn.net/u014454538/article/details/126218249

查询jdk版本,确定有多个jdk

/usr/libexec/java_home -V

    1..8.371.11 (x86_64) "Oracle Corporation" - "Java" /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
    1.8.0_382 (x86_64) "Amazon" - "Amazon Corretto 8" /Users/xxx/Library/Java/JavaVirtualMachines/corretto-1.8.0_382/Contents/Home
    1.8.0_371 (x86_64) "Oracle Corporation" - "Java SE 8" /Library/Java/JavaVirtualMachines/jdk-1.8.jdk/Contents/Home

在.bash_profile中不要使用第一个,使用包含JavaVirtualMachines的

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值