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
Find android-sdk-windows\tools\lib\find_java.bat
and add something like the following:
set java_exe=
call :TestJavaDir "%JAVA_HOME%"
if defined java_exe goto :EOF
What worked for me was this:
add a path to your java/bin directory to the system Path variable. Do NOT include java.exe.
Steps on Win 7 64bit:
Try it out!
hth,
\ ^ / i l l
C:\Windows\SysWOW64
1down vote
I also had this same problem -> accidentally installed the 32-bit version of Java SDK -> uninstalled -> installed the 64-bit version (Windows 7 64) -> -> the Android SDK setup never found Java correctly!
I discovered a java.exe floating around in C:\Windows\SysWOW64 folder. After renaming this java.exe to javaX.exe, the Android Setup ran just fine!
It is really hell with JDK detection...
My params: Win 7 x64 + JDK x64 (JDK path (c:\Program Files\Java\jre7\bin)
Was googling and playing around with env variables may be 1 hour - no way.
Finally come with such solution
Manually edit android-sdk-windows\tools\lib\find_java.bat
by hardcoding the path to java.exe
set java_exe=c:\Progra~1\Java\jre7\bin\java.exe
if not defined java_exe goto :CheckFailed
:SearchJavaW
set javaw_exe=c:\Progra~1\Java\jre7\bin\javaw.exe
if not exist %javaw_exe% set javaw_exe=%java_exe%
goto :EOF
Thats works for me.
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:
java.exe
is on your PATH
.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.
I had this same problem, after accidentally installed the 32-bit version of Java SDK. I uninstalled it and installed the 64-bit version (since I'm using Windows 7 64). The Android SDK setup never found Java correctly, even after I added it to my PATH variable!
After a bit of digging around, I discovered a java.exe floating around in my system32 folder, which in the order of the PATH variable came before my SDK path. After whacking the java.exe in my system32 folder, the Android Setup ran just fine!
Hope this helps.