Use JAVA_HOME on windows if defined

This commit is contained in:
vladimir 2020-03-21 12:02:17 -05:00 committed by Connor Tumbleson
parent f3136bc52b
commit 54c3cfedf5

View File

@ -3,6 +3,12 @@ setlocal
set BASENAME=apktool_
chcp 65001 2>nul >nul
set java_exe=java.exe
if defined JAVA_HOME (
set java_exe="%JAVA_HOME%\bin\java.exe"
)
rem Find the highest version .jar available in the same directory as the script
setlocal EnableDelayedExpansion
pushd "%~dp0"
@ -30,7 +36,7 @@ if "%ATTR:~0,1%"=="-" if "%~x1"==".apk" (
)
:load
java -jar -Duser.language=en -Dfile.encoding=UTF8 "%~dp0%BASENAME%%max%.jar" %fastCommand% %*
%java_exe% -jar -Duser.language=en -Dfile.encoding=UTF8 "%~dp0%BASENAME%%max%.jar" %fastCommand% %*
rem Pause when ran non interactively
for /f "tokens=2" %%# in ("%cmdcmdline%") do if /i "%%#" equ "/c" pause