6

After a couple of months with no Android development, I ran the SDK Manager yesterday, and upgraded from r16 to r18. After that upgrade, everything stopped working. I downloaded a fresh copy of the SDK tools from Google. The Windows installer complains there's no Java installed (the solution here , which used to work before, doesn't work).

I downloaded the ZIP file instead and put it in the right place. Running SDK Manager.EXE does nothing (it just returns immediately to the command prompt). Running tools\android.bat displays an error complaining "Failed to convert path to a short DOS path: c:\windows\system32\java.exe", and then suggests I install Java.

I'm running Windows 7 64-bit, with Java 1.7 (64 bit) properly installed (Eclipse runs well, the Android tools r16 ran very well until yesterday). c:\windows\system32\java.exe exists and works as it should.

What am I doing wrong?

UPDATE: I found an old r16 setup around. I installed it and everything went back to normal.

4

5 に答える 5

23

I put this one aside for a while, but now I had to get it back running. I didn't want to install a 32-bit Java VM alongside the 64 bit one I have.

I found the culprit. in android_sdk\tools\lib there's a batch-file called find_java.bat. It calls find_java.exe -s to find a list of potential Java locations. Running the exe file like this returns the error I've been seeing:

Failed to convert path to short DOS path: c:\windows\system32\java.exe

-s stands for short. Running it without the -s causes find_java.exe to work, causing find_java.bat to work, causing everything else to work. So the fix was to edit find_java.bat, and remove the -s .

I honestly don't know what Google is thinking.

于 2012-06-12T08:26:19.067 に答える
3

My fix was to remove /bin from my JAVA_HOME, as in C:\Java\jdk1.6.0_26\bin --> C:\Java\jdk1.6.0_26\

I'm running 64bit java on W7.

This google issue was helpful: http://code.google.com/p/android/issues/detail?id=23648

于 2012-09-11T18:15:01.720 に答える
2

This is just a guess, but I advise you to install JDK 6. It is said in the SDK requirements that you have to use it. I remember that I installed JDK 7 and I had some kind of trouble with it too.

Also it is safer to use the 32-bit version.

于 2012-05-26T21:50:19.373 に答える
0

You need to also update the Eclipse plugins via Help > Install New Software.

于 2012-05-26T21:50:29.180 に答える
0

I was able to fix same like problem by adding the jdk path to PATH variable in environment variables.

于 2014-08-06T15:10:15.820 に答える