Back
Java is an optional package on the latest versions of macOS.
Yet once installed it appears like the JAVA_HOME environment variable is not set properly.
With the Java elective package or Oracle JDK installed, combining one of the subsequent lines to your ~/.bash_profile file will set the environment variable respectively.
export JAVA_HOME="$(/usr/libexec/java_home -v 1.6)"
or
export JAVA_HOME="$(/usr/libexec/java_home -v 1.7)"
export JAVA_HOME="$(/usr/libexec/java_home -v 1.8)"
31k questions
32.8k answers
501 comments
693 users