14

I am trying to install Android SDK on windows 7 64-bit but it doesn't work. I keep getting this screen:

JAVA SE Development Kit (JDK) not found.  
Error: Failed to find Java version for 'C:\Windows\system32\java.exe': [2] The system cannot find the file specified.  (...)   
If you believe you have a JDK installed and it was not properly recognized, simply set an environment variable JAVA_HOME to point to it.

I tried setting JAVA_HOME to C:\Windows\System32\java.exe (which is my install path) and it still doesn't work.

In the command line i tested the version with java -version and it works perfectly.

Tried the old trick of back and next but sadly doesn't work.

this is so disappointing.... any suggestions?

Siva Charan
  • 17,940
  • 9
  • 60
  • 95
Moshe Shaham
  • 15,448
  • 22
  • 74
  • 114
  • possible duplicate: [Installing Android SDK on Windows 7 64-bit](http://stackoverflow.com/q/4384433/1048330) – tenorsax Apr 10 '12 at 22:52

7 Answers7

18

It's JDK, not Java, it's missing. JAVA_HOME shouldn't point to the java.exe file. It should point to the jdk-folder. Typically C:\Program Files\Java\jdk1.6.0_23 or similar. If you haven't got a jdk-folder somewhere, you should install JDK from here.

Note that the official requirement for developing for Android is JDK 6.

Matsemann
  • 21,083
  • 19
  • 56
  • 89
6

Setting the JAVA_HOME environment variable in System variable to C:\Program Files\Java\jdk1.7.0_07\ did solve my problem.

A couple of points to note:

  1. No need to specify bin or jre folder name.
  2. You will need to cancel and restart the android sdk installation. Previous/Next may not work.
  3. I just copied the folder name from Windows explorer address bar. No need to replace the \ with /.
LittleBobbyTables - Au Revoir
  • 32,008
  • 25
  • 109
  • 114
daniele
  • 167
  • 3
  • 10
1

A change in one of the batch files since release 16 of the Android Tools SDK is probably the culprit. Try the ZIP file instead of the EXE. Download android-sdk_r18-windows.zip from http://developer.android.com/sdk/index.html. Unzip to a new Android directory where your program files normally reside (other locations should also work). Replace find_java.bat in the Android\android-sdk\tools\lib directory with the one from the release 16 SDK tools (if you haven't got it get it from https://tekeye.uk/downloads/find_java.zip). Using the ZIP instead of the EXE means the shortcuts and program groups won't be set up but you can run SDK Manager.exe in the android-sdk folder to grab the rest of the SDK.

Daniel S. Fowler
  • 1,982
  • 15
  • 12
1

Download JDK 64bit from http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

Add the system variable JAVA_HOME pointing to C:\Program Files\Java\jdk1.7.0_21

ilevende
  • 11
  • 1
1

Here are the setup steps that worked for me starting from scratch (as of today - 6/26/2013)

[Setup Steps]

Part I - Java JDK

  1. Remove all Java programs installed on PC.
  2. Go to: http://www.oracle.com/technetwork/java/javase/downloads/index.html (This is Java JDK download site)
  3. [http://www.oracle.com/technetwork/java/javase/downloads/index.html]->Mouseclick
  4. Select the radio button, , and select and download and save it into any temporary directory.
  5. Mouse click to highlight, jdk-7u25-windows-x64.exe, then right-click-mouse and select to start installation process and install as default settings.

Result: Java JDK installation will be completed as expected

Part II - Android SDK (Preliminary Setup)

  1. [PC:Home]->mouse-click
  2. [PC:Start Menu]->mouse-click
  3. [PC:Control Panel]->mouse-click
  4. [PC:System]->mouse-click
  5. [PC:Advanced system settings]->mouse-click
  6. [PC:Environment Variables:System variables]->mouse-click
  7. [PC:New System Variable]->Fill in as follows:
    • Variable name : JAVA_HOME
    • Variable value: C:\Program Files\Java\jdk1.7.0_25 ->mouse-click
  8. Shut down / Restart PC

This is to make sure the change in environment variable will work

Part III - Android SDK

  1. Go to: http://developer.android.com/sdk/index.html
  2. [http://developer.android.com/sdk/index.html]->mouse-click
  3. Download the following and save it into any temporary directory on your PC:
    • installer_r22.0.1-windows.exe (recommended)
  4. Mouse-click the downloaded , then right-click-mouse and select to start installation process and install as default settings.

Result: Android SDK installation will be completed as expected

Simon MᶜKenzie
  • 8,344
  • 13
  • 50
  • 77
Tommy
  • 11
  • 1
0
  1. Unzip the .exe using 7zip or similar or redownload the .zip
  2. Do what the installer would have done: create tools and plugin directories and put the files in $COMMONFILES etc into tools and plugins as appropriate
  3. Open an (admin?) cmd window
  4. CD to tools/lib, notepad find_java.bat, notice it calls find_jave.exe with -s.
  5. then try find_java.exe -s. It will say: Failed to convert path to a short DOS path: C:\Windows\system32\java.exe (Which is a perfectly short path already - bizarre.)
  6. Remove the -s from the two calls to find_java.exe inside the .bat. Save it
  7. Run /tools/android.bat
Marko
  • 20,385
  • 13
  • 48
  • 64
Sam
  • 1
0

Easiest solution I have Windows 7 x64 After installing Java JDK 64bit it didnt work but: After installing both x32 and x64 it worked :) Enjoy