7

Android SDK installation doesn't find JDK is not the same release as this, and the solution "back" then "next" doesn't work.

I have tried installing various versions of Java and nothing seems to be working. I've been trying to get this installed for the last 3 days. Solutions I have tried that do NOT work:

  • Pushing the back button then the next button.
  • Adding an Environment Variable for JAVA_HOME that points to the System32 path and the actual java install directory.
  • Installing various versions of Java. (Java 6 and Java 7)

The install file is called installer_r20.0.3-windows and is the current exe available at http://developer.android.com/sdk/index.html

Error Message java.exe

Community
  • 1
  • 1
teynon
  • 7,540
  • 10
  • 63
  • 106
  • what happens when you fire `javac` at your command prompt ? – Lucifer Aug 21 '12 at 03:35
  • It gave an error. After that, I added `C:\Program Files\Java\jdk1.6.0_34\bin` to the "Path" env var and it now works in command prompt, but the installer still doesn't work. – teynon Aug 21 '12 at 03:39
  • can you print the path variable's value ? – Lucifer Aug 21 '12 at 03:39
  • I should mention that this is a brand new installation of Windows 7 on a brand new PC. (Installed 3 days ago) `C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Java\jdk1.6.0_34\bin` – teynon Aug 21 '12 at 03:40
  • ok, as it is windows system , i suggest you to restart your pc once. – Lucifer Aug 21 '12 at 03:42
  • I've restarted just about every time I've tried something, but I did it again just now and still nothing. – teynon Aug 21 '12 at 03:45
  • ok, what is the value of your `JAVA_HOME` ? – Lucifer Aug 21 '12 at 03:46
  • Currently: C:\Program Files\Java\jdk1.6.0_34\bin Although I have tried C:\Program Files\Java\jdk1.6.0_34\bin\java.exe – teynon Aug 21 '12 at 03:47
  • 1
    oh ok, change it to `C:\Program Files\Java\jdk1.6.0_34` , you do not nee to add bin folder in the JAVA_HOME Path. – Lucifer Aug 21 '12 at 03:48
  • Post your answer as a solution please. – teynon Aug 21 '12 at 03:52
  • Yes, please post as answer so I can mark it correct. :) – teynon Aug 21 '12 at 03:52
  • Thanks, not sure why they had to make it so hard to install, heh. – teynon Aug 21 '12 at 04:17
  • I believe that, from the path, it automatically search for javac.exe and other .exe files, so you dont need to add full the path till .exe file, otherwise it may omit the upper folder's other .exe file to get execute( this is only my belief ). – Lucifer Aug 21 '12 at 04:19

3 Answers3

6

Ok, looking at to your JAVA_HOME path which is C:\Program Files\Java\jdk1.6.0_34\bin I suggest you to change it as C:\Program Files\Java\jdk1.6.0_34\. There is no need to add bin folder's path in the JAVA_HOME Path.

Lucifer
  • 29,392
  • 25
  • 90
  • 143
5

On my Win7 Ultimate 64 bits/ i need multiple things

  1. Set SystemEnvironment Variable JAVA_HOME = C:\Program Files\Java\jdk1.7.0_07
  2. Add the same value to SystemEnvironment Variable PATH, but make sure to put it before system32 path PATH = C:/Program Files/Java/jdk1.7.0_07;C:\Windows\system32; ....... (... = current value)
  3. and most important , i guessed. Rename c:\windows\system32\java.exe -> c:\windows\system32\java.exe.old
  4. Restart the installer (my case = installer_r20.0.3-windows.exe )

Voila!

This might help safe other's time

Eric F.
  • 309
  • 4
  • 11
  • what's the point of renaming java.exe to java.exe.old? this method worked but I can't understand the reason behind renaming... – saji159 Jul 15 '13 at 04:52
  • @saji159 I would guess that renaming it does two things: 1) It makes the java.exe not get called first when "java" is called and it preserves the backup / old java.exe. – teynon Feb 13 '14 at 16:48
2

Setting 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 /.
Zoltan Toth
  • 46,981
  • 12
  • 120
  • 134
daniele
  • 167
  • 3
  • 10