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.

Community
  • 1
  • 1
zmbq
  • 38,013
  • 14
  • 101
  • 171
  • I had a similar problem, did you try manually changing the registry? http://stackoverflow.com/a/4739559/1267661 – Sam May 26 '12 at 21:44
  • I just did, it didn't change anything. – zmbq May 26 '12 at 21:51
  • I also had trouble with the JDK PATH variable once: http://docs.oracle.com/javase/tutorial/essential/environment/paths.html – Sam May 26 '12 at 21:52

5 Answers5

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.

zmbq
  • 38,013
  • 14
  • 101
  • 171
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

ether_joe
  • 1,068
  • 1
  • 13
  • 32
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.

Malcolm
  • 41,014
  • 11
  • 68
  • 91
  • Up until yesterday I had no trouble with JDK 7 and 64-bit. Why did it break? I really don't want two Java platforms installed unless I absolutely have to. – zmbq May 26 '12 at 21:52
  • @zmbq Obviously, they rely on some specific behavior of JDK 6 or don't wish to test their code against JDK 7 for some reason. You got lucky everything worked fine, but unfortunately this is not always the case. By the way, I remembered what was exactly the problem with JDK 7: I couldn't sign my APKs. – Malcolm May 26 '12 at 21:55
  • OK, I'll try downgrading to JDK 6 (I don't need JDK 7's additional features). – zmbq May 26 '12 at 21:57
  • Downgrading to JDK 6 (64-bit version) did not work - the error is exactly the same. – zmbq May 27 '12 at 14:28
  • @zmbq As I said, it is better to try the 32-bit version. – Malcolm May 27 '12 at 15:29
0

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

Jason Robinson
  • 31,005
  • 19
  • 77
  • 131
0

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

Andrew
  • 4,953
  • 15
  • 40
  • 58
Cheque
  • 1