Error: JAVA_HOME is not defined correctly executing maven

前端 未结 14 1542
时光说笑
时光说笑 2020-11-28 05:50

I installed java and set path to environment and when I execute echo $JAVA_HOME I get the following output:

/usr/lib/jvm/java-7-oracle/jre/bin/j         


        
14条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-28 06:45

    If you are using mac-OS , export JAVA_HOME=/usr/libexec/java_home need to be changed to export JAVA_HOME=$(/usr/libexec/java_home) . Steps to do this :

     $ vim .bash_profile
    
     export JAVA_HOME=$(/usr/libexec/java_home)
    
     $ source .bash_profile
    

    where /usr/libexec/java_home is the path of your jvm

提交回复
热议问题