Nuñito Calzada
Nuñito Calzada

Reputation: 2056

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

Upvotes: 2

Views: 1776

Answers (1)

tcox5698
tcox5698

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

Related Questions