执行maven命令 Error: JAVA_HOME is not defined correctly executing maven

来源:互联网 发布:php 点击链接下载文件 编辑:程序博客网 时间:2024/06/07 02:21


Assuming you use bash shell and installed Java with the Oracle installer, you could add the following to your .bash_profile

export JAVA_HOME=$(/usr/libexec/java_home)export PATH=$JAVA_HOME/jre/bin:$PATH

This would pick the correct JAVA_HOME as defined by the Oracle installer and will set it first in your $PATH making sure it is found.

Also, you don't need to change it later when updating Java.




参考:https://stackoverflow.com/questions/27319495/error-java-home-is-not-defined-correctly-executing-maven

阅读全文
0 0