Created
August 28, 2020 17:31
-
-
Save Fleshgrinder/b80633e85d33f1eafbcbc34a9b8b7600 to your computer and use it in GitHub Desktop.
Load Zulu JDKs into jEnv
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
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
if ! command -v jenv &>/dev/null; then | |
echo 'Could not find jenv in your PATH, make sure it is installed correctly and in your PATH.' >&2 | |
exit 1 | |
fi | |
readonly JENV_HOME=${JENV_HOME:-"$HOME/.jenv"} | |
if [[ ! -d "$JENV_HOME" ]]; then | |
echo "Missing $JENV_HOME directory, is jenv correctly installed?" >&2 | |
exit 1 | |
fi | |
mkdir -p "$JENV_HOME/versions" | |
shopt -s nullglob | |
for j in /usr/lib/jvm/zulu-* /Library/Java/JavaVirtualMachines/zulu-*/Contents/Home; do | |
jenv add "$j" | |
done | |
shopt -u nullglob |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment