简体   繁体   中英

setting JAVA_HOME in in OS X Yosemite 10.10.4

trying to set JAVA_HOME to execute maven but there is no way

$ which java
/usr/bin/java
$ export JAVA_HOME=/user/bin/
$ mvn
Error: JAVA_HOME is not defined correctly.
  We cannot execute /user/bin//bin/java

$ export JAVA_HOME=/Library/Java
$ mvn
Error: JAVA_HOME is not defined correctly.
  We cannot execute /Library/Java/bin/java

您可以使用类似这样的东西-但是用您的计算机上实际使用的Java版本代替Java版本:

export JAVA_HOME=`/usr/libexec/java_home -v 1.8`

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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