I recently updated to ADT r17. Ever since then, none of the android tools could see java on my system. I could not launch AVD Manager, SDK Manager, Draw-9patch, anything. The only way I could get an AVD to launch was to compile from eclipse without my phone plugged it. Java is still on my system, everything was working perfectly on r16. I can still go into the command line and type java and javac and everything works.
I uninstalled the sdk (by deleting the folder) and am attempting to reinstall it. The installer doesn't even see java. I tried clicking back and next again. No dice. I have in my system variables:
JAVA_HOME C:\Program Files\Java\jdk1.7.0_03\bin
I just did that one after the first failed attempt to reinstall since that's what is recommended on the installer. Did not help. What was working before was:
...F:\Development\Android\android-sdk\platform-tools;C:\Program Files\Java\jdk1.7.0_03\bin;...
I can confirm that at the end of the filepath, in the bin folder, java.exe and all it's other programs are there. I'm downloading the .zip sdk, but I don't think that's going to help much, since none of the tools seem to see java even when extracted. Edit: I can confirm, simply extracting the .zip did not help.
I'm on a 64bit system. Everything was working with r16. Any ideas? Should I go back to r16?
You can reference here: http://code.google.com/p/android/issues/detail?id=28196
I set JAVA_HOME=d:\jdk1.7\jre\ (which is my JDK's directory) to solve this problem.
For whatever reason, adt r17 decided it did not like 64bit Java, even though r16 was fine with it. Installed 32bit java and added that to my path. Everything is fine now.
Related
I've been trying to fix this for the last 48 hours, and it is driving me insane.
My SDK Manager.exe flashes a cmd screen and closes in less than a second.
After much searching, I finally managed to get my SDK Manager to open after adjusting android.bat, and running it as administrator.
But, SDK Manager.exe was not able to find android.bat so I copied it into the android-sdk folder.
SDK Manager.exe is now able to find android.bat, but it is still briefly flashing cmd and then closing.
My PATH variable has my jdk java.exe directory as the first entry, and I have restarted and reinstalled several times.
What is causing this? Why am I able to open the manager from android.bat, but not from the executable?
I am trying to configure Eclipse to use the SDK Manager, but obviously I cannot because the executable refuses to open.
Eclipse is also telling me that adb.exe is missing, and upon checking platforms I have confirmed this. I assume adb.exe will be installed from the SDK Manager?
Edit: After thinking about it, I think the issue may be with the permissions of android.bat. It must be run as administrator in order to work, otherwise if opened regularly it will say "Access is denied".
Is it possible to change this? Looking in the properties of android.bat, I have adjusted my account to have full control. This has not affected the issue, though.
I've experienced this on some machines, but not others. It's a strange problem and I believe it has to do with a path problem in one of the android files (android.bat?).
Why this happens on some installs and not others I have yet to figure out. I've read everything I could find both here and on the interweb, tried many different solutions, including installing another version of JDK 6 and 7, modifying the path variable, adding a JAVA_HOME variable, etc. and none worked.
This worked for me in Windows 7...
1) Add a copy of the "SDK Manager.exe" file INSIDE the SDK folder (so it's next to the tools, platforms, et. al folders) and then run it. You will still see the command window "flash" for a second and then disappear, but be patient and the SDK manager WILL show up.
2) Create a shortcut to this "inside" copy of the SDK Manager.exe and move it where ever you want; it now knows where to go to find the files and works every time. I have a copy on my desktop, but it doesn't matter where you put it.
Note: There's still a problem somewhere, and it may have to do with Google, but it seems to happen to some people regardless of what/when they do an install, while others have no issues at all.
This may not be the answer we need to get Google to fix it, but it works without uninstalling/reinstalling java or the SDK, modifying/adding variables, modifying android.bat, changing your path, running as admin, etc., and the best part is it's easy. It's too bad many of us have wasted hours of time on trying to fix it.
Good Luck!
Note: I added the comment below about x64 machines. It's strange, but when we tried it on one x64 (OS/ADT) machine and it didn't work. I just tried a fresh install of Java 7 x64, and ADT x64 on a machine where it was working with a 32bit install (meaning I now have both 32bit and 64bit installs of Java and ADT on the same machine) and again, it works fine. A brief flash, it goes away, and then the SDK manager opens as expected. The mystery continues. :)
I had the same problem when I updated my android SDK tools to 23.0.2. Spent a lot of time (around 6 hours) messing around trying to find a fix... and I found it, but still not sure how it all works.
It has to do with android.bat file in the tools folder of your android SDK directory, in the lines:
set java_exe=
call lib\find_java.bat
I modified the lines into the following values:
set java_exe=pathwhereyoufindjavaexe
REM call lib\find_java.bat
Basically, two things are done:
Set your java_exe variable to your Java.exe path
Delete, or comment the line: "call lib\find_java.bat"
I commented second line so it DOESN'T re-set my java_exe variable through find_java.bat, and manually set my java_exe variable to where my java.exe file is. If you don't know where (or forgot where) your java.exe is, try using windows search for it.
My path for java.exe is different from the one found using find_java.bat.
My Actual path:
U:\PortableApps\CommonFiles\Java\bin\Java.exe
The path find_java.bat sets it to:
C:\Windows\systems32\java.exe
NOTE:
I figured what path "call lib\find_java.bat" sets the java_exe variable through adding the following command below the line itself:
echo %java_exe%
pause
I'm not sure if this is some sort of permission or access error, or this solution worked only for me since my java JDK is on USB device or such. Well, if anyone else bump into this problem, give my solution a try and see if it works for you guys as well.
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 installed Java 32-bit.
The easy fix is to install both versions. You can download them manually here.
Good luck!
I don't know if it will solve your problem but make sure you have installed jre and jdk and android sdk for the same bit system (I mean that all three are for 32 or 64 bit systems).
I once had an android problem based on this!
If you use them for one system try to reinstall them.
I had a similar problem and it worked after changing all versions to 64 bit.
Hope I could help you.
When you 'Run as administrator' the current directory gets changed because you are impersonating another user. To prove this put the following line at the top of your bat file:
echo.CD=%CD% & pause
Then execute your bat file as a normal user and observe result.
Now execute bat file via 'Run as administrator' and note that CD has been changed to C:\Windows\system32 (typical).
The fix is simple. Put the following line in your bat file to restore the current directory:
pushd %~dp0
It needs to be before you reference any files/folders. I typically put that line near the top of all bat files that may be 'Run as administrator'. It does not hurt anything if used for older (XP) OS's.
I had same problem with Windows 8.1 64-bit and JDK8. I uninstalled JDK8x64 and installed JDK8i586 and now it works like a charm.
I just downloaded the Android Developer Tools Bundle. I started following the setup instructions and gotten as far as extracting the files to new location ("Development") as it says. I tried running the Eclipse app as instructed, yet a window popped up saying;
A Java Runtime Environment (JRT) or Java Development Kit (JDK) must be available in order to run Eclipse. No Java virtual machine was found after searching the following location:
C:.........\Development\adt-bundle-windows\eclipse\jre\bin\javaw.exe
javaw.exe in your current PATH"
I tried compatibility trouble-shooter which can not detect a thing, whether it was the right action to take. I looked across stackoverflow and tried a few of the suggestions with no change. I looked at windows site and android site and nothing seems to make any difference, good or bad (well, I hope no bad).
I literally got this laptop 10 days ago and all programs are brand new, no updates or reinstalls etc.
I am running a Windows 8 with 64bit, which is what I selected at download of ADT Bundle.
I had downloaded the wrong java file.
To fix I went to;
http://www.oracle.com/technetwork/java/javase/downloads/jdk7u7-downloads-1836413.html
and accepted terms then downloaded the appropriate file which I had to signup for registration;
Windows x64 90 MB jdk-7u7-windows-x64.exe
It worked without changing any PATH.
Thank you..
At first download jdk(java development kit) and install it. the jdk includes the jre(java runtime environment). You can also install the jre alone.
Thank It worked. Just add C:\Program Files\Java\jdk1.7.0\bin in your PATH
Control Panel
1. System
2. Advance Setting
3. Advance
4. Environment Variables
5. System variable Group
6. look For PATH in the list
7. Edit
8. Add path of your C:\Program Files\Java\jdk1.7.0\bin jdk installation and save
Remember to separate value with ;
You must download a JDK or JRE first from java.oracle.com, and add your installation folder in the PATH system avaiable.(Control Panel --System--Advance Settings --advance -- enviroment)
Go to the following page and download the executable on java.com
The executable installs the latest JAVA virtual machine.
NOTE: for Windows only
The installer knows your current version of windows.
I am going nuts.I update to the Android SDK in Eclipse, Eclipse can't find the SDK. There is a text not that saids the the file has been moved to /platform-tools, however the file ADB.exe is nowhere to be found in any of my folders. The SDK Manager works find but for some reason Eclipse will not find the file its looking for. I have looked everywhere for the answer. It work find for about 4 months until I upgraded. I also now using a real device a Droid X2. But I don't believe this is the issue. I can't find the ADB.exe file. Help been working on this for about 2 days
adb.exe was relocated from {ANDROID_SDK_FOLDER}/tools to {ANDROID_SDK_FOLDER}/platform-tools: find your SDK folder and look inside it for the platform-tools folder.
EDIT: in Eclipse, if you open the Preferences dialog (Window->Preferences) and select the Android option on the left it will show you what Eclipse THINKS is your Android SDK folder. If you moved the SDK folder you should update the path to match the new location of the SDK folder, and then (a restart might be necessary) Eclipse should work fine with the Android tools.
EDIT: well, I can't tell if your ADT isn't properly installed or if the SDK location is broken, so lets try and brute force set the SDK location. Create a text file on your desktop called "adt.pref", and then place only this line in it:
/instance/com.android.ide.eclipse.adt/com.android.ide.eclipse.adt.sdk=C\:\\Program Files\\Android\\android-sdk
then in Eclipse select File->Import then select General->Preferences and then pick that file. This should force the ADT location to match what that is. Restart Eclipse and see if that improves things.
I had the same problem and solved it by running the android sdk-manager (you can do that without running eclipse, using the start menu shortcut) and installing the Android SDK Platform-Tools through it (select the square and click install packages...).
Download the SDK here.
Once that's done, I would just follow the Google installation instructions again from the beginning. Perhaps you're missing something fairly simple?
Installation instructions.
I got the same problem. In my case it was caused by an upgrade on the Java JDK. I was using 1.6 and upgraded to 1.7.
Just manually add the new JDK to Eclipse.
Right click on your project JRE System Library. Select installed JRE, and then find it on your computer.
I had the same problem, and when I looked inside the platform-tools folder, it was empty.
After searching for downloading the contect of this folder, I found the below link.
http://venomvendor.blogspot.com/2012/06/android-adt-20-updated-download-offline.html
But it also could not help me.
At last I found that it's related to my internet connection.
I upgraded to Gingerbreak 2.3 SDK today and started receiving this error when I try to run DDMS:
Failed to get adb version: Cannot run program "adb": CreateProcess error=2, The system cannot find the file specified.
How can I fix this? Running Windows 7, 64bit.
It seems that adb.exe is now in the SDK's platform-tools folder. I had to add the platform-tools folder to my PATH in my Environment Variables.
I tried to upgrade my perfectly working Android dev system yesterday with the new 2.3 SDK and associated ADT. After the upgrade, I couldn't get Eclipse to compile my project correctly, nor could I access the Android SDK and AVD Manager from Eclipse. Eclipse seems to have lost track of where the Android SDK was installed. I would give it the name of the folder, but then it could come back saying it couldn't find .../tools/adb.exe. Yes I know adb.exe moved. But notice that the error was looking for it in the old spot. It's like I didn't have the new ADT, but I checked and rechecked and I did. I'm thinking that the new ADT didn't install correctly for some reason, and/or I wasn't checking it's version properly.
When I searched around for a solution, everyone pointed out that adb moved and that the classpath needed to change. But there isn't really a relevant classpath in this situation. There is just a path to the Android SDK that needs to be set in Eclipse. I even tried the trick were I copied adb.exe back to the tools folder. At that point, Eclipse could find the Android SDK, but then some other problem that crept up so I gave up on that hole.
Anyway, I ended up blowing away my eclipse and Android SDK folders and starting over. Now it works fine. I'm sure there's a better solution, but I was sick of messing with it.
I'm now 2 for 4 on using Android SDK and AVD Manager to do an upgrade.
Hope this helps someone.
Update: Upon further review, I seem to have my stackoverflow topics mixed up since the OP never mentioned Eclipse.
I had the same problem and it works like this . First run adb.exe , after open ddms.bat
I'm using Windows 7 and installed the 64 bit version of Eclipse 3.5.2. I then installed the Android ADT plugin, but when I try to configure it in the Windows > Preferences dialog, the Android Plugin doesn't show up in the left pane. Instead I see DDMS. This prevents me from specifying the location of the Android SDK (unless there is another way) to give me the appropriate templates and such.
Someone posted a fix to this that includes setting the permissions of Eclipse, but that didn't work for me. I tried installing the Android Plugin from both online installation (thru the URL install) and the offline Archive method.
If you're running Windows Vista or 7, make sure you right-click Eclipse and RUN AS ADMINISTRATOR. I literally spent six hours figuring this out, and this was what fixed it.
Dear people from the future:
I had roughly the same problem in linux, except that i didn't see anything at all but vanilla eclipse after installing. by combining both previous answers i got it to work:
start eclipse with sudo eclipse -clean, install the plugins and restart eclipse. the plugins showed up including the welcome screen that's supposed to be there.
after that it should work when running as regular user as well.
works for both the android sdk and the gwt sdk. (and probably other eclipse plugins)
Remove the plugin, then restart as follows:
eclipse -clean
Now try reinstalling the ADT from the online installation
For users having similar problem and not luck with other solutions:
I have windows XP but had same problem. I realized that I had JDK5/bin folder in my PATH environment variable (though my JDK_HOME was pointing to JDK6), as soon as I modified the PATH to replace bin of JDK5 with JDK6, the Android buttons on eclipse (after restart with -clean) along with Android option in Preferences & New Project showed up. (Weird eh!)
Also, consider to install the bundle android installation having eclipse with pre-configured Android SDK if a new eclipse installation doesn't matter to you
http://developer.android.com/sdk/installing/bundle.html
The above answers do not confront the heart of the problem. There is a feature in Windows 7 that prevents downloaded files from direct access of local files. All of the state is perfectly maintained in the Eclipse workspace instance. The problem is easily resolved by doing the following:
Find the "Eclipse" executable
Right-click on it.
Click "Properties".
Select the "General" tab.
Look for -> Security: "This file came from another computer and might be blocked..."
Click Unblock.
This is a much better solution than uninstalling and reinstalling the ADT or Eclipse which can be a pain.