0 votes
1 view
in Java by (3.9k points)

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.

 

1 Answer

0 votes
by (42.6k points)

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)"

or

export JAVA_HOME="$(/usr/libexec/java_home -v 1.8)"

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...