Can't get Android SDK Manager to open

93,764

Solution 1

Open cmd,

go to android sdk folder,

in tools/lib/, edit find_java.bat,

you will see the lines like below, add black line to your file and save.

rem Check we have a valid Java.exe in the path. The return code will

rem be 0 if the command worked or 1 if the exec failed (program not

found). for /f %%a in ('%~dps0\find_java.exe -t') do set java_exe=%%a

this

set java_exe="C:\Program Files\Java\jdk1.7.0_11\bin\java.exe"

if not defined java_exe goto :CheckFailed

:SearchJavaW

rem Check if we can find a javaw.exe at the same location

than java.exe. rem If that doesn't work, just fall back on the

java.exe we just found. for /f %%a in ('%~dps0\find_java.exe -t -w')

do set javaw_exe=%%a if not exist %javaw_exe% set javaw_exe=%java_exe%

set javaw_exe="C:\Program Files\Java\jdk1.7.0_11\bin\java.exe"

i hope it helps

Solution 2

Answer by Talha is correct. Just adding that you might need to NOT include quotation marks in the black lines in his solution.

The following addition worked for me:

set java_exe=C:\Program Files\Java\jdk1.7.0_11\bin\java.exe

Solution 3

Found out what the cause of this problem was in my case: In the registry, there was a setting to have the CMD using UTF-8 (chcp=65001).

If I double click C:\Programmer\Android\SDK Manager.exe, I get the described symptoms.

If double click C:\Programmer\Android\sdk\tools\lib\SDK Manager.exe there is a hint: A pop-up stating: Failed to execute tools\android.bat

Starting a CMD window in C:\Programmer\Android\sdk\tools and running android.bat, gave no output, even if editing the file and reming out the initial @echo off. Running the command chcp returned 65001.

So changing the codepage with chcp 850 and then running android.bat again, I got output, ending with the line: call lib\find_java.bat. This turned out to be the same problem. Each time a new CMD was spawned, the codepage changed to 65001

Fixed the problem by editing the following registry entry, deleting the value, and everything worked:

HKEY_LOCAL_MACHINE->SOFTWARE->Microsoft->Command Processor->AutoRun: @chcp 65001>nul

Having an empty value here, make the CMD using codepage 850, and the bat files begin to work again.

I am not quite sure what has made this change in the first place, but now I know the cure.

Solution 4

When extracting the adt-bundle-windows-x86_64-20131030.zip, three files were broken:

("sdk/tools/lib/httpcore-4.1.jar","sdk/tools/lib/find_java.exe","sdk/tools/lib/sdk-common.jar")

I don't know why but you can replace these files using old versions of android SDK e.g. android-sdktools_installer_r20.0.1-windows.exe. It worked for me.

Solution 5

After much searching.......and installing...re-intalling.....and changing the path of the android.bat as the answers above mentioned.....the final solution was: running Eclipse or the bat file or Android studio as administrator in windows 8 for the manager to open up!

Share:
93,764
Admin
Author by

Admin

Updated on September 15, 2020

Comments

  • Admin
    Admin over 3 years

    Having searched here and elsewhere for answers to my problems, I'm still unable to fix this.

    I've installed Eclipse, ADT Plugin, and the Android SDK. My problem is that the SDK Manager won't open, whether it is launched from Eclipse or directly. The command prompt window flashes up briefly, then closes.

    I've tried several proposed solutions: Various configurations of my Path and JAVA_HOME variables, installation of the 32 and 64 bit versions of the JDK, running as Administrator, all with no success.

    The different components are installed at these paths:

    JDK - C:\Program Files\Java\jdk1.7.0_11
    JRE - C:\Program Files\Java\jre7
    SDK - C:\ADT\sdk
    

    My JAVA_HOME is set to C:\Program Files\Java\jdk1.7.0_11 My Path includes C:\Program Files\Java\jdk1.7.0_11\bin at the beginning.

    I've tried reinstalling the SDK and the installer correctly identifies the location of Java, and yet still it won't work.

    Can anyone help me out with this? I'm practically tearing my hair out!

  • Admin
    Admin over 11 years
    Excellent! This solved the problem. I think it was the set javaw_exe part that was missing from all the other answers. Thank you!
  • Robe Elckers
    Robe Elckers almost 11 years
    If this does not work try setting environment variable 'ANDROID_SWT' to point to the folder where swt.jar is located (should match your architecture, 32 or 64 bit). For example: d:\android-sdk\tools\lib\x86_64
  • Deepak Gupta
    Deepak Gupta almost 11 years
    thanx its very helpful ...but what is JAVA_HOME ..and how to set [ath for it
  • Nam G VU
    Nam G VU over 10 years
    I use this stackoverflow.com/a/14392081/248616 By just running the android.bat file and works
  • antikbd
    antikbd over 10 years
    I'm getting an "unrecognised command" error. I have done exactly as shown in the lines. I'm guessing there is some syntax error. Any way to fix this?
  • Stephen Lautier
    Stephen Lautier over 10 years
    just added this one and it worked! thanks to you and @Talha. As a note, just watch out when you update JAVA because probably it will break every time, since its pointing to a version specifically.
  • Talha
    Talha almost 10 years
    pls double check your java path
  • Admin
    Admin over 8 years
    Note: If you can't find the find_java.bat file, go into cmd and type "dir /s/b \find_java.bat" and it will tell you the location of each find_java.bat file.
  • m0skit0
    m0skit0 almost 7 years
    This solution is bad because it will break everytime you update Java. At least use JAVA_HOME instead.
  • m0skit0
    m0skit0 almost 7 years
    Eclipse is running so Java is installed.