mirror of https://github.com/jenv/jenv.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
428 B
23 lines
428 B
#!/usr/bin/env bash |
|
# |
|
# Summary: Display path to selected JAVA_HOME |
|
# |
|
# Usage: jenv javahome |
|
# |
|
set -e |
|
[ -n "$JENV_DEBUG" ] && set -x |
|
|
|
# Provide jenv completions |
|
if [ "$1" = "--complete" ]; then |
|
exec jenv shims --short |
|
fi |
|
|
|
JENV_VERSION="$(jenv-version-name)" |
|
|
|
if [ "$JENV_VERSION" == "system" ]; then |
|
echo "Using system JDK, no JAVA_HOME set!" >&2 |
|
exit 1 |
|
fi |
|
|
|
JAVA_HOME="$JENV_ROOT/versions/$JENV_VERSION" |
|
echo "$JAVA_HOME"
|
|
|