Noble Ds
Noble Ds

Reputation: 53

Error launching SDK manager: "find_java.exe is not compatible with the version of Windows you're running"

I am trying to start the android sdk manager in android studio, but it shows me the following error

https://plus.google.com/u/0/113311995935504360295/posts/h5EKzabisQj?pid=6068461235610543378&oid=113311995935504360295

Cannot launch SDK manager

Output:

This version of C:\PROGRA~1\Android\ANDROI~1\sdk\tools\lib\find_java.exe is not compatible with the version of Windows you're running. Check your computer's system information to see whether you need a x86 (32-bit) or x64 (64-bit) version of the program, and then contact the software publisher.

ERROR: No suitable Java found. In order to properly use the Android Developer Tools, you need a suitable version of Java JDK installed on your system.

As for the error message, In my system I have 32-bit java sdk1.7, 32-bit OS, already setup my JAVA_HOME variable to the java installation path, still it shows the same error. In another system, I have 64-bit configuration, It works well, any help would be appreciated.

Upvotes: 3

Views: 10705

Answers (6)

user4348640
user4348640

Reputation: 1

There is 2 issue in find_java.bat

  1. conflict with dos find and unix find.

    --> use findstr instead of find

  2. miss setting "arch_ext"

    (currently arch_ext set to "32 " (space included))

    --> delete space after 32

Then you should


- find /i "x86" > NUL && set arch_ext=32 || set arch_ext=64

+ findstr /i "x86" > NUL && set arch_ext=32|| set arch_ext=64


Upvotes: 0

marco
marco

Reputation: 3242

The same issue reported above ( https://code.google.com/p/android/issues/detail?id=77289 ), returned with the r24 version bundle in Android Studio 1.0

The bug is in tools\lib\find_java.bat, just below these lines

reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" |^
find /i "x86" > NUL && set arch_ext=32 || set arch_ext=64

add the correct instruction for your system, for example

set arch_ext=32

Upvotes: 0

Noble Ds
Noble Ds

Reputation: 53

Thanks a lot for the help guys. I just upgraded my windows to a 64bit version. Updated the JDK to a 64bit version. Now everything is working fine.

Upvotes: 0

Scott Barta
Scott Barta

Reputation: 80020

You don't say in your question, but it sounds like you have recently updated your SDK to 23.0.4. If that's the case, there's a bug in the release documented here:

https://code.google.com/p/android/issues/detail?id=77289

The bug is that there was a bad version of the find_java.exe utility shipped with that version. This is fixed in 23.0.5, which is out now.

As a different workaroud you can either replace that utility from a previous version of the SDK, or you can copy the find_java.exe linked to from comment #11 in the bug:

http://dl.google.com/android/installer_r23.0.2-windows.exe

into the tools\lib\ directory in your SDK.

Upvotes: 1

Alam
Alam

Reputation: 93

Just fixed the same issue. The SDK Manager is now opening without any issue at my end.

Solution 1 (working fine): Download the find_java.exe file from previous (working) SDK. Link: Google Drive Paste & replace the file you downloaded to %ProgramFiles%\\tools\lib\

Solution 2: Download the previous SDK and replace it with current version. Link: http://dl.google.com/android/installer_r23.0.2-windows.exe

Solution 3: In /tools/android.bat set java_exe = %ProgramFiles%\\bin\java.exe comment out REM call lib\find_java.bat

Upvotes: 5

Olkunmustafa
Olkunmustafa

Reputation: 3203

When I used windows, I had a similiar error. First off you should check watchfully JAVA_HOME path. If you are sure that your JAVA_HOME path maybe two different jdk is installed on your computer. You match your JAVA_HOME and jdk path of Android Studio.

Upvotes: 0

Related Questions