Created
September 19, 2018 14:32
-
-
Save nhojpatrick/b07afb0c7a89d8c5d005394ba98c46fe to your computer and use it in GitHub Desktop.
Set Java
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
# java | |
function setJdk { | |
JAVA_HOME=`/usr/libexec/java_home -v "$1"` ; | |
if [ $? -eq 0 ]; then | |
export JAVA_HOME ; | |
java -version 2>&1 ; | |
fi | |
} | |
export -f setJdk ; | |
setJdk 1.8 1>/dev/null ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment