[java] SDK Manager.exe doesn't work

When I clicked SDK Manager on Program Files or run it in cmd, nothing happened. I did:

  1. Installed latest JDK
  2. Installed latest Android SDK
  3. Set environment JAVA_HOME and put %JAVA_HOME%\bin in path variable**

Actually a black cmd window appears and disappears a milliseconds.

How to fix it?

Edit:

I Googled day by day but can't find a solution for this. Even I set path for ANDROID_SWT it also can't run. I suspect that Android SDK has bug in its installation package.

I'm totally exhausted and this is the last my try:

  1. Uninstall JDK, Android SDK, remove all ANDROID or JAVA environment variables
  2. reinstall JDK and Android SDK

But nothing changes.

Edit:

Actually this is the second time I meet this problem. I got this problem only after I added more Environment variables for Ant and Maven. This is the summary:

Install Windows XP SP3 --> Install JDK --> Install Android SDK --> Open SDK Manager and it works! --> append some more "bin" path of Ant and Maven in "path" variable --> Open SDK Manager and it doesn't open --> I rolled back by removing all environment variables --> SDK Manager still no opens! That's very strange! --> It is stranger when I reinstall JDK and Android SDK, it still no opens! :(

This question is related to java android environment-variables

The answer is


After a lot of searching and trying different methods, I found the solution to the problem at my end: SDK Manager couldn't find my profile directory. After setting the environment variable ANDROID_SDK_HOME (I set mine to a newly created folder C:\Android), SDK manager started no prob.


I fixed this issue by reinstalling it in Program Files, it originally tried to install it in c:/Users/.../AppData/Android/....

Mine was caused by a user permission issue that running as admin didn't seem to fix (perhaps because they call batch files?).


When I clicked SDK Manager on Program Files or run it in cmd, nothing happened

One of your problems is Long File Names in Windows. A number of the Android tools cannot handle them. I filed a bug report on them years ago, but I can't find it at the moment. I also seem to recall something about it in the INSTALL or README.

So you should install the tools in a location without spaces. Use something like C:\Android\ or C:\Android-SDK\.

@Steve and @MeatPopsicle already mentioned spaces in the pathames, but it can't be overstated.


Actually a black cmd window appears and disappears a milliseconds.
... Even I set path for ANDROID_SWT

Out of curiosity, where did ANDROID_SWT come from?

I know Android does use ANDROID_HOME, ANDROID_SDK_ROOT and ANDROID_NDK_ROOT, and the last two should both be set because the tools use them internally. Here's the reference on ANDROID_SDK_ROOT and ANDROID_NDK_ROOT: Recommended NDK Directory?.

So you should set the three environmental variables (after ensuring the installation directory does not contain spaces):

  • ANDROID_HOME
  • ANDROID_SDK_ROOT
  • ANDROID_NDK_ROOT

ANDROID_HOME is set to the directory where the hidden directory .android is.

ANDROID_SDK_ROOT is set to the directory where the SDK is installed, like C:\Android-SDK\.

ANDROID_NDK_ROOT is set to the directory where the NDK is installed, like C:\Android-NDK\. If its not installed, then don't set it.


Once you have ANDROID_SDK_ROOT set, you can put %ANDROID_SDK_ROOT%\tools and %ANDROID_SDK_ROOT%\platform-tools on PATH. Then, you can drop into a command line and issue something like this (and it just works):

adb list

I have Wondows 7 64 bit (MacBook Pro), installed both Java JDK x86 and x64 with JAVA_HOME pointing at x32 during installation of Android SDK, later after installation JAVA_HOME pointing at x64.

My problem was that Android SDK manager didn't launch, cmd window just flashes for a second and that's it. Like many others looked around and tried many suggestions with no juice!

My solution was in adding bin the JAVA_HOME path:

C:\Program Files\Java\jdk1.7.0_09\bin

instead of what I entered for the start:

C:\Program Files\Java\jdk1.7.0_09

Hope this helps others.... good luck!


Step #1: Open up a command prompt.

Step #2: Use the cd command to move to wherever you installed your Android SDK.

Step #3: Run tools\android.

If that does not work, you should have information dumped to the command prompt that will help you diagnose your setup problem.


I had the same problem.

when i run \tools\android.bat, i got the exception: Exception in thread main

 java.lang.NoClassDefFoundError: com/android/sdkmanager/Main

My resolved method:

  1. edit \tools\android.bat
  2. find "%jar_path%;%swt_path%\swt.jar"
  3. modify to "%tools_dir%\%jar_path%;%tools_dir%\%swt_path%\swt.jar"
  4. save, and run SDK Manager.exe again

My issue was the following error on windows 7:

C:\dev\Android\android-sdk-windows\tools>android
[INFO] Starting Android SDK and AVD Manager
No command line parameters provided, launching UI.
See 'android --help' for operations from the command line.
Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-win32-3550 or
swt-win32 in swt.library.path, java.library.path or the jar file
        at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
        at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
        at org.eclipse.swt.internal.C.<clinit>(Unknown Source)
        at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
        at com.android.sdkmanager.Main.showMainWindow(Main.java:292)
        at com.android.sdkmanager.Main.doAction(Main.java:276)
        at com.android.sdkmanager.Main.run(Main.java:99)
    at com.android.sdkmanager.Main.main(Main.java:88)

The solution was to disable McAfee 8.8. Apparently some recent update is now blocking my Android environment.


I had the same problem, running X64 Java (1.7.0_03-b05). Even though I had both C:\Program Files\Java\jre7\bin and C:\Program Files\Java\jdk1.7.0_03\bin listed in my path, it wouldn't start - just flashed a command prompt.

The tools\lib\find_java.bat file was reporting that it was attempting to run C:\Windows\system32\java.exe but failed. Huh? I checked, and found outdated copies of java.exe, javaw.exe and javaws.exe in my C:\Windows\system32. How did those get there, I didn't put them there!

I deleted those three files from C:\Windows\system32 and the problem was fixed.

Thinking about it, the problem likely would have been fixed by making sure thatC:\Program Files\Java\jre7\bin and C:\Program Files\Java\jdk1.7.0_03\bin were at the START of my PATH variable instead of tacked onto the end.


I FINALLY GOT THIS WORKING AFTER 2 SOUL DESTROYING EVENINGS OF TRYING! IF I EVER MEET AN ANDROID SDK DEVELOPER I WILL HACK HIM TO DEATH WITH HIS OWN KEYBOARD

Anyway, tips for getting it working on Windows 7 64 bit...

I suspect for me it was multiple problems as none of the suggestions worked so I will list all the things I did to finally get it working

1) Install the 32 BIT version of Java JDK (yes, even if you are running 64bit Windows)

2) Install both the SDK and the JDK to paths that have no spaces in (I used C:\Android and C:\Java32)

3) In the Windows environment variables screen (System Properties > Advanced Settings > Env vars), there's two places you can enter the variables, the "User Variables" and "System variables". I put them in both and included the "bin" bit in both e.g.

JAVA_HOME = C:\Java32\jdk1.8.0_20\bin

Path = C:\Java32\jdk1.8.0_20\bin;other paths should come AFTER the jdk...

4) Edit the file tools\android.bat and look for the following:

set java_exe=

call lib\find_java.bat

change this to:

set java_exe="C:\Java32\jdk1.8.0_20\bin\java.exe"

rem call lib\find_java.bat

You can also put the "@echo off" to "@echo on" at the top of the file for debugging purposes

Good luck!


Similar to sixty9 I renamed java.exe, javaw.exe, javaws.exe (I never delete files when troubleshooting) after I created a JAVA_HOME environment variable and added path variables.

I had installed the Java SDK on my D:\ drive ( instead of the default).

  1. Create a JAVA_HOME variable: Variable Name: %JAVA_HOME% Value: D:\Program Files\Java.

  2. Added the following to the Path variable:

    %JAVA_HOME%\jre7\bin;%JAVA_HOME%\jdk1.7.0_03\bin;
    
  3. Renamed java.exe, javaw.exe and javaws.exe.

  4. Restarted the system and the Android SDK installer found my JDK and installed successfully.


Finally got this torterous SDK to run.

When installing 32bit Java on 64bit windows system, set ANDROID_SWT to e:\android-sdk\tools\lib\x86

not ..\x86_64

Dear Android SDK team,

I genuinely hope some serious attention is being paid to these problems. SDK should be effortless to set up. This is how you lose customers to other platforms where this kind of thing is a one-click ordeal.

I was going to buy another android device to test my game on, but after last 2 days trying to traverse the maze of your incompetence I think i'll just stick with iOS as my main development target.


And if tools\android works for you while .exe doesn't, it's probably the x64 java.

It started working when i completely uninstalled JDK with JRE (shows as separate option in windows uninstal control panel applet) and android sdk and reinstalled using x86 version.

Why does it worth the time, you may ask? Well, such an inconsistency obvoiusly means that amount of testing with x64 java is zero and so you can probably experience many other failures in the future.


I add new environment variable "ANDROID_SDK_HOME" and set it, like my path to android SDK folder (c:/Android) and it's work!


What I did was:

set a new environment variable in the top user section.

VARIABLE NAME: JAVA_HOME VARIABLE VALUE: set it to the installation directory of your most recent JDK.

For me it was, C:\Program Files\Java\jdk1.7.0_13 . Run SDK Manager as administrator at least once. I use windows 7. This method worked for me after a lot of research.

What I dont understand is when using 'where java' in the command prompt it still references C:\Windows\System32\java.exe. My SDK Manager now opens when I need it so I solved my problem.


I had this same problem and after trying a variety of things like changing the path variables I went to java.com on a whim and downloaded java, installed, and lo and behold the sdk manager worked after that.


I solved this problem, which occured for me after manually installing the ADT (4.2/api 17) bundle on Windows 7 64 bit in C:\Program Files.

The steps I had to take:

  1. Set the JAVA_HOME environment variable to the installation directory of the (64 bit) JDK, C:\Program Files\Java\jdk1.7.0_11 in my case.
  2. Run SDK Manager as administrator at least once. SDK Manager allows you to change files in Program Files, so you should give it the proper access rights.

I had the same issue!

I had installed the ADT bundle 64-bit, so I downloaded Java 64-bit. I messed around with paths and things, but the thing that fixed it in the end was installing Java 32-bit.

The easy fix is to install both versions. You can download them manually here.

Good luck!


Had the same problem and tried everything I browse in several forums till I found a clue, then finally solved the problem.

Basically I installed the SDK and worked ok, then my Windows Vista crashed, on restart I run SDK again but it only opened a CMD window which closed immediately.

So here's a list of useless things I did:

  • Went to CMD "d:/java/android/tool" and execute "android.bat", didn't work and show an pointer exception error.
  • Reinstalled the whole thing JDK + SDK
  • Changed the system path to a new folder
  • I traced and deleted all android occurrences on Regedit

At this point I was seriously considering start learning objetive-c was not a bad idea, finally I did this:

  • delete ".android" folder from "c:/users/youruser/"
  • delete all files within "c:/users/youruser/AppData/Local/Temp"
  • reinstall SDK

it WORKED !! I'm not sure though if is necessary to uninstall SDK (since I had again to download all packages & platforms) and just clear the temp folder.

Hope this helps.


find_java.exe doesn't seem to like the openjdk "java -version" output. I edited find_java.bat like this:

for /f %%a in ('%~dps0\find_java.exe -s') do set java_exe=%%a
set java_exe="C:\Program Files (x86)\AdoptOpenJDK\jdk-8.0.242.08-hotspot\bin\java.exe"

rem ...

for /f %%a in ('%~dps0\find_java.exe -s -w') do set javaw_exe=%%a
set javaw_exe="C:\Program Files (x86)\AdoptOpenJDK\jdk-8.0.242.08-hotspot\bin\javaw.exe"

I was getting the error "C:\Program is not recognized as an internal or external command" Followed by loads of "unable to copy file" Followed by something about Android_SWT not being able to be found.

The way I fixed the problem on my system (Windows 8, 64 bit, JDK 7) was:

  1. Create JAVA_HOME environment variable and point it to C:\Program Files\Java\jdk1.7.0_10\bin
  2. Open ANDROID SDK DIRECTORY\tools\android.bat in your favorite text editor
  3. Find the lines set java_exe= call lib\find_java.bat (it's split over 2 lines)
  4. Replace the lines with set java_exe="%JAVA_HOME%\java.exe"
  5. Save and run tools\android.bat

The problem was that the the space in the path was not being handled correctly. By wrapping the path in quotation marks, the space is then correctly catered for.


The way I solved your last problem was by right clicking the android.bat file, and chose edit with notepad++. I then went down to the part of the program where it had this bit of code:

cd /d %~dp0

It was also some other lines of code, but I deleted them. After deleting these other lines I simply just wrote(under the cd /d %~dp0):

cd Program Files

cd java

cd jdk1.7.0_03

cd bin

I dont know here you java.exe file is located but mine was at lest located there.


None of the Solution worked for me

Just open sdk/tools/

Edit android.bat

Replace set java_exe="C:\Program Files\Java\jdk1.7.0_13\bin\java.exe" //your java path

Copy the sdk manager and avd from any tools/lib if its not in sdk/ base folder


I was experiencing the UnsatisfiedLinkError on Windows 7 64-bit after installing adt-bundle-windows-x86_64-20130717.zip:

 Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-win32-3550 or swt-win32 in swt.library.path, java.library.path or the jar file

The root cause was that McAfee has a feature that blocks loading DLL's from the temporary directory. This is a problem because android.bat copies a bunch of JAR and DLL files to a temporary directory and runs the program from there, to make it easy to upgrade the app in-place.

This feature can be disabled, however. You can either disable "Access Protection" altogether or only disable the feature that blocks loading DLLs from temporary folders.

Screenshot showing the McAfee UI where access protection can be disabled Screenshot showing the McAfee UI where you can disable the feature where it blocks loading DLLs from the temp directory


I solved my problem opening android.bat inside sdk/tools and setting the java_exe property, which was empty.

set java_exe="C:\Program Files\Java\jre6\bin\java"

I ran into this problem: I'd get the error

C:\projects\Android\android-sdk-windows-1.5_r1\tools\lib>ddms
02:03:07 E/ddms: shutting down due to uncaught exception
02:03:07 E/ddms: no swt-win32-3550 or swt-win32 in swt.library.path, java.library.path or the jar file
java.lang.UnsatisfiedLinkError: no swt-win32-3550 or swt-win32 in swt.library.path, java.library.path or the j
ar file
        at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
        at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
        at org.eclipse.swt.internal.C.<clinit>(Unknown Source)
        at org.eclipse.swt.graphics.FontData.<init>(Unknown Source)
        at com.android.ddms.PrefsDialog.setDefaults(PrefsDialog.java:221)
        at com.android.ddms.PrefsDialog.init(PrefsDialog.java:150)
        at com.android.ddms.Main.main(Main.java:74)

I got this solved by copying the swt file from eclipse into the tools directory. If you search in the directory you have Eclipse installed there is an SWT dll, named something like swt-win32-<4-digits>.dll (mine was named swt-win32-3740.dll): I copied that into the tools directory, and everything worked after that.


Examples related to java

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How much should a function trust another function How to implement a simple scenario the OO way Two constructors How do I get some variable from another class in Java? this in equals method How to split a string in two and store it in a field How to do perspective fixing? String index out of range: 4 My eclipse won't open, i download the bundle pack it keeps saying error log

Examples related to android

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How to implement a simple scenario the OO way My eclipse won't open, i download the bundle pack it keeps saying error log getting " (1) no such column: _id10 " error java doesn't run if structure inside of onclick listener Cannot retrieve string(s) from preferences (settings) strange error in my Animation Drawable how to put image in a bundle and pass it to another activity FragmentActivity to Fragment A failure occurred while executing com.android.build.gradle.internal.tasks

Examples related to environment-variables

Using Environment Variables with Vue.js Adding an .env file to React Project Is there any way to set environment variables in Visual Studio Code? Test process.env with Jest How to set environment variables in PyCharm? ARG or ENV, which one to use in this case? how to set ASPNETCORE_ENVIRONMENT to be considered for publishing an asp.net core application? What is a good practice to check if an environmental variable exists or not? Passing bash variable to jq Tensorflow set CUDA_VISIBLE_DEVICES within jupyter