1. Find the android.bat file in the android-sdk-windows\tools directory
2. Right-click the android.bat file and select Edit.
找到如下位置:
rem Check we have a valid Java.exe in the path.
set java_exe=
call lib\find_java.bat
if not defined java_exe goto :EOF
3. Change the path to the absolute path of java
rem Check we have a valid Java.exe in the path.
set java_exe="absolute path of java"
Note: There must be no spaces in the path. Therefore, the default installation path "C:\Program Files\Java\jdk-20\bin\java.exe" is also not applicable, and the "Program Files" folder name contains spaces.
My installation path:
rem Check we have a valid Java.exe in the path.
set java_exe="F:\Java\jdk-20\bin\java.exe"