Created
February 5, 2019 17:50
-
-
Save AndyDangerous/614a64420809a43b7d305aa7ef16f371 to your computer and use it in GitHub Desktop.
JAVA_HOME get 'n set script
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
#!/bin/sh | |
if [["-h" = "$1" || "--help" = "$1" || $# != 1 ]]; then | |
echo "Switches your JAVA_HOME from jdk using /usr/libexec/java_home. USAGE: " | |
echo " jdk [1.8 | 11]" | |
echo "Your current JAVA_HOME=$JAVA_HOME" | |
exit | |
else | |
export JAVA_HOME=`/usr/libexec/java_home -v $1` | |
echo "You now have JAVA_HOME=$JAVA_HOME" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment