From 54c3cfedf5737c10ad6037e17eebe74840270f7b Mon Sep 17 00:00:00 2001 From: vladimir Date: Sat, 21 Mar 2020 12:02:17 -0500 Subject: [PATCH] Use JAVA_HOME on windows if defined --- scripts/windows/apktool.bat | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/windows/apktool.bat b/scripts/windows/apktool.bat index 634d95db..65423027 100755 --- a/scripts/windows/apktool.bat +++ b/scripts/windows/apktool.bat @@ -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