1

I've done several searches for this, but none of the answers have worked for me. The machine is a brand new Windows 7 64-bit PC. I have the whole SDK, Eclipse system working on my older 32-bit PC without a problem, but I'm trying to migrate to the new one.

Things I've tried:

  • Make sure that the bin directory of the JDK is the first thing in my PATH so as to not use the C:\windows\system32\java.exe
  • Tried both JDK 6 (6u32) and JDK 7 (7u5), x64 version in both cases
  • Run as Administrator

I tried to see if there were any errors so I ran it from the command prompt. There was absolutely no message at all, just nothing happened. I've tried re-booting.

The one thing I did do that made it run (but this didn't seem to me to be the best way) was to edit the tools/android.bat file. I got rid of the search for java.exe (basically, the call to find_java.bat) and set the java_exe environment variable directly in the android.bat file.

Is there something I'm missing or is this the best way? It seems a bit non-intuitive.

5
  • 1
    Can you run Java from the command line? Jul 6, 2012 at 3:31
  • Yes. And running "where java" returns both the jdk locatiom (first) and the system32 location (second).
    – sr71pav
    Jul 6, 2012 at 10:10
  • did you get the 64-bit version of eclipse? Jul 8, 2012 at 6:53
  • Yes, though the issue is not in Eclipse. It has something to do with the way the Android SDK Manager tries to launch with Java. Once I modified tools/android.bat to just trust that my PATH env variable is correct and not try to find where java.exe is, everything works. This feels like a bug in the SDK system. My guess is that it cannot handle spaces in the path names (i.e. "Program Files"). I'm going to try re-installing java to a different directory with no spaces and see if that fixes the issue. It is running, so I can work, I just don't like having to make the changes by hand.
    – sr71pav
    Jul 9, 2012 at 12:34
  • Good point - I remember having issues w/ my new windows x64 with space names, always made a dir called "dev" and installed everything in there, which yes, then sucks because you have to manage every install vs. default. You could try removing the 32-bit java call in classpath and see if it works. Jul 9, 2012 at 22:51

2 Answers 2

0

The last set of comments covers what the solution was.

Simply put, don't have spaces in the path name! The Java SDK was installed into the "Program Files" directory. The space was causing havoc for the method that Google was using to find the java.exe. By re-installing the Java SDK to another directory (i.e. d:\apps), it solved the problems I was having.

So, lesson learned for anyone else who encounters this.

0

My solution (paraphrasing what was in the question itself):

First, check if typing java -version works on your command line

Then, find and change the lines in tools\android.bat to the following:

rem Check we have a valid Java.exe in the path.
set java_exe=java
rem call lib\find_java.bat
rem if not defined java_exe goto :EOF

Finally, go to your sdk root directory in the command prompt, and run tools\android.bat

This will let your android.bat file work even without needing to re-install Java in a non-space path.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.