尝试设置JAVA_HOME来执行maven但是没有办法
$ 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
答案 0 :(得分:2)
您可以使用类似的东西 - 但将java版本替换为您计算机上实际的版本:
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`