简体   繁体   English

Maven无法识别在bash_profile中设置的JAVA_HOME

[英]Maven not recognizing JAVA_HOME being set in bash_profile

Going on nearly 2 days wasted trying to get maven properly installed. 持续将近2天的时间浪费在尝试正确安装Maven上。 These are my outputs. 这些是我的输出。 Why in the world is maven defaulting to some jdk I don't even have??? 为什么世界上Maven缺省使用我什至没有的jdk ??? I have tried a million different solutios proposed from goole searches and nothing!!! 我已经尝试了从goole搜索中提出的一百万种不同的solutios,什么也没有! Help. 救命。 I have not made any changes to any config files such as mvn.sh . 我尚未对任何配置文件(例如mvn.sh进行任何更改。

System: Mac
OS=Yosemite 10.10
Java=Oracle 1.8 JDK

contents of .bash_profile: .bash_profile的内容:

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home
export M2_HOME=/usr/local/Cellar/maven/3.2.3
export M2=$M2_HOME/bin
export PATH=$PATH:$M2_HOME/bin

terminal commands: 终端命令:

java -version -> 
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

mvn -version -> 
Error: JAVA_HOME is not defined correctly.
    We cannot execute /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/bin/java

如果有人碰巧遇到了这个疯狂的愚蠢的解决方案,那就是我在主目录中有一个旧的.mavenrc文件,该文件导致了冲突。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM