Skip to content

Instantly share code, notes, and snippets.

@jdollar
Created September 27, 2015 13:08
Show Gist options
  • Save jdollar/b97526f7f1d40c0070b2 to your computer and use it in GitHub Desktop.
Save jdollar/b97526f7f1d40c0070b2 to your computer and use it in GitHub Desktop.
Grailsw Default JAVA_HOME exports
# OS specific support (must be 'true' or 'false').
cygwin=false;
darwin=false;
mingw=false;
case "`uname`" in
CYGWIN*)
cygwin=true
;;
Darwin*)
darwin=true
;;
MINGW*)
mingw=true
;;
esac
# Attempt to set JAVA_HOME if it's not already set
if [ -z "$JAVA_HOME" ]; then
# Set JAVA_HOME for Darwin
if $darwin; then
[ -z "$JAVA_HOME" -a -d "/Library/Java/Home" ] &&
export JAVA_HOME="/Library/Java/Home"
[ -z "$JAVA_HOME" -a -d "/System/Library/Frameworks/JavaVM.framework/Home" ] &&
export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Home"
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment