Skip to content

Instantly share code, notes, and snippets.

@Fleshgrinder
Created August 28, 2020 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fleshgrinder/b80633e85d33f1eafbcbc34a9b8b7600 to your computer and use it in GitHub Desktop.
Save Fleshgrinder/b80633e85d33f1eafbcbc34a9b8b7600 to your computer and use it in GitHub Desktop.
Load Zulu JDKs into jEnv
#!/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