Reputation: 2056
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
Upvotes: 2
Views: 1776
Reputation: 111
You can use something like this - but substitute the java version with the one actually on your machine:
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
Upvotes: 3