Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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