“Android Create” call fails in windows 7 - missing JDK

前端 未结 8 912
孤独总比滥情好
孤独总比滥情好 2020-12-05 21:43

I\'m having a problem getting my android dev environment setup in Windows 7. I follow the instructions here, as well as several environment sublinks. I am using Eclipse wi

8条回答
  •  情话喂你
    2020-12-05 22:05

    The android command is just a Windows Batch file which in turn uses the batch file tools\lib\find_java.bat to find Java.

    Having a look at the source, it does the following:

    1. Looks to see if java.exe is on your PATH.
    2. Looks for java.exe in somewhere under %ProgramFiles%

    Your problem arises because you're using the a 64-bit version of Windows. This means %ProgramFiles% is C:\Program Files but Java is installed in C:\Program Files (x86) as it's a 32-bit application, meaning find_java.bat doesn't find it.

    So to fix this you'll need to add the directory containing java.exe to your PATH environment variable.

    You'll need to the add the directory containing java.exe - something like C:\Program Files (x86)\Java\jdk6\bin - on to the end of PATH with a semicolon in front of it to separate it from the previous entry.

    This question on superuser.com covers maintaining Environment Variables in Windows 7.

提交回复
热议问题