[Turn] Gradle: There should be no androidandroid-studiosdk oolslib\find_java.exe at this time. Workaround

Source: Internet
Author: User
Tags goto

The above problem is mainly the Java path problem, here is the main solution, as for why so solve, you can learn the bat language. If you want to ask me, you can leave a message.

Dx.bat according to the installation directory, my is D:\Program Files (x86) \android\android-studio\sdk\build-tools\android-4.2.2\dx.bat. Then open with a notebook, in the 29~33 line (I use the edit plus,txt may not be the actual number of rows, we can find the following corresponding on the line).

Then replace the following code with the

------------------------the original Code---------------------------------------

REM Check we have a valid Java.exe in the path.
Set java_exe=
if exist. \tools\lib\find_java.bat call. \tools\lib\find_java.bat
if exist. \.. \tools\lib\find_java.bat call. \.. \tools\lib\find_java.bat
If not defined Java_exe goto:eof

---------------------------------------------------------------------

Replaced by

----------------------------------------------------------------------

REM Check we have a valid Java.exe in the path.
Set java_exe= "C:\Program Files (x86) \java\jdk1.6.0\bin\java.exe"
if exist. \tools\lib\find_java.bat call. \tools\lib\find_java.bat
:: if exist.. \.. \tools\lib\find_java.bat call. \.. \tools\lib\find_java.bat
:: If not defined Java_exe goto:eof

----------------------------------------------------------------------

Then find the Android.bat file under \android\android-studio\sdk\tools. 35~38 line code, as follows:

------------------------the original Code---------------------------------------
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
--------------------------------------------------------------------

Replaced by

------------------------the original Code---------------------------------------

REM Check we have a valid Java.exe in the path.
Set java_exe= "C:\Program Files (x86) \java\jdk1.6.0\bin\java.exe"
:: Call Lib\find_java.bat
:: If not defined Java_exe goto:eof


--------------------------------------------------------------------

The above "C:\Program Files (x86) \java\jdk1.6.0\bin\java.exe" is my JDK installation path, just modify it. I wish you success!

[Turn] Gradle: There should be no androidandroid-studiosdk oolslib\find_java.exe at this time. Workaround

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.