Last active
December 6, 2021 17:14
-
-
Save joemaffia/8775d78ab4b883553816 to your computer and use it in GitHub Desktop.
Set $JAVA_HOME Environment Variable On Mac OS X
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# OSX 10.5 or later Apple recommends to set the $JAVA_HOME variable to /usr/libexec/java_home | |
# so just export $JAVA_HOME in file ~/.bash_profile or ~/.profile or ~/.zshrc | |
# /usr/libexec/java_home return the Java version specified in Java Preferences for the current user. | |
export JAVA_HOME=$(/usr/libexec/java_home) | |
#specific version | |
#export JAVA_HOME=$(/usr/libexec/java_home -v 1.8) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment