Fix check for java_home with missing java

This commit is contained in:
ViViDboarder 2024-11-26 15:17:19 -08:00
parent 40487ecb59
commit 2e7344776f
3 changed files with 3 additions and 3 deletions

View File

@ -52,7 +52,7 @@ if [ -d "$ANDROID_HOME" ]; then
fi
# Java paths
if type /usr/libexec/java_home &> /dev/null ; then
if type /usr/libexec/java_home &> /dev/null && /usr/libexec/java_home &> /dev/null ; then
export JAVA_HOME="$(/usr/libexec/java_home)"
fi

View File

@ -52,7 +52,7 @@ if [ -d "$ANDROID_HOME" ]; then
fi
# Java paths
if type /usr/libexec/java_home &> /dev/null ; then
if type /usr/libexec/java_home &> /dev/null && /usr/libexec/java_home &> /dev/null ; then
export JAVA_HOME="$(/usr/libexec/java_home)"
fi

View File

@ -84,7 +84,7 @@ _maybe_set -a PATH "$ANDROID_HOME/tools/bin"
_maybe_set -a PATH "$ANDROID_HOME/platform-tools"
# Java paths
if type -q /usr/libexec/java_home
if type -q /usr/libexec/java_home && /usr/libexec/java_home &> /dev/null
set -gx JAVA_HOME (/usr/libexec/java_home)
end