You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# We're on macOS, which has its own way of doing Java
JAVA="/usr/libexec/java_home -exec java"
elif JAVA_PATH="$(which java 2>/dev/null)" || JAVA_PATH="$(command -v java 2>/dev/null)"; then
# Fall back to java on the PATH (covers Homebrew/OpenJDK installs
# that aren't registered with java_home)
JAVA="$JAVA_PATH"
fi
if [ -z "$JAVA" ]; then
if [[ "$SHELL" == *"zsh"* ]]; then
echo "Could not find a Java runtime. Install one (e.g., \`brew install openjdk\`) and set \`JAVA_HOME\` in ~/.zshrc if needed, then restart your shell." >&2
else
echo "Could not find a Java runtime. Install one (e.g., \`brew install openjdk\`) and set \`JAVA_HOME\` in your shell rc file if needed, then restart your shell." >&2