Android SDK installation doesn't find JDK

JavaAndroidSdkWindows 7-X64Jdk6

Java Problem Overview


I'm trying to install the Android SDK on my Windows 7 x64 System.

jdk-6u23-windows-x64.exe is installed, but the Android SDK setup refuses to proceed because it doesn't find the JDK installation.

Is this a known issue? And is there a solution?

SDK Error

Java Solutions


Solution 1 - Java

Press Back when you get the notification and then Next. This time it will find the JDK.

Solution 2 - Java

Actual SETUP:

  • OS: Windows 8.1
  • JDK file: jdk-8u11-windows-x64.exe
  • ADT file: installer_r23.0.2-windows.exe

Install the x64 JDK, and try the back-next option first, and then try setting JAVA_HOME like the error message says, but if that doesn't work for you either, then try this:

Do as it says, set JAVA_HOME in your environment variables, but in the path use forward slashes instead of backslashes.

Seriously.

For me it failed when JAVA_HOME was C:\Program Files\Java\jdk1.6.0_31 but worked fine when it was C:/Program Files/Java/jdk1.6.0_31 - drove me nuts!

If this is not enough, also add to the beginning of the Environment Variable Path %JAVA_HOME%;

Updated values in System Environment Variables:

  • JAVA_HOME=C:/Program Files/Java/jdk1.8.0_11
  • JRE_HOME=C:/Program Files/Java/jre8
  • Path=%JAVA_HOME%;C:...

Solution 3 - Java

I found the solution and it's beautifully stupid. I found Android SDK cannot detect JDK.

Press the Back button on the SDK error screen that tells you that the EXE couldn't detect the JDK. Then press Next.

Who would have thought that would happen?

Solution 4 - Java

It seems like it doesn't work without 32 bit JDK. Just install it and be happy...

Solution 5 - Java

I downloaded the .zip archive instead and ran SDK Manager.exe, and it worked like a charm. You had the same issue with the .exe otherwise.

Solution 6 - Java

Warning: As a commenter mentioned, don't try this on a Windows 7! I tested it with Windows XP 64 bit.

As the posted solution does NOT work for all (including me, myself, and I), I want to leave a note for those seeking for another way (without registry hacking, etc.) to solve this on a Windows 64 bit system. Just add PATH (capital letters!!) to your environment Variables and set the value to your JDK-Path.

I added JDK to the existing "Path" which did not work, like it didn't with JAVA_HOME or the "Back"-Solution. Adding it to "PATH" finally did the trick.

I hope this might be helpful for somebody.

Solution 7 - Java

All you need are the following two registry entries. It appears as if whoever posted the other registry stuff basically just copied all the keys from HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft into HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft, which obviously isn't an ideal solution because most of the keys aren't needed.

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Development Kit]
"CurrentVersion"="1.6"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Development Kit\1.6]
"JavaHome"="C:\\Program Files\\Java\\jdk1.6.0_23"

Solution 8 - Java

Non of these solutions worked for me. I fixed it by temporarily changing the filename of C:\Windows\System32\java.exe to java_.exe

Solution 9 - Java

None of the solutions here worked for the 64-bit version.

Putting the JDK path before the c:\windows\system32\ path in your environment variables solves the problem. Otherwise the 32-bit java.exe is found before the 64-bit JDK version.

Solution 10 - Java

After reading a couple of blog posts, it does seem to be even an easier fix by clicking BACK when the installer says couldn't find the JDK, and then simply click NEXT again and magically it finds the JDK. No registry messing around or re-downloading etc..

Solution 11 - Java

Adding JAVA_HOME environment variable (under System Variables) did the trick for me. Clicking "Back" and "Next" buttons didn't work.

Windows 7 Professional x64, JDK 1.7.0_04 (64 bit, I don't have x86 version installed)

I think that installer tries to find JDK in specific (1.6?) version and if it can't find it, checks JAVA_HOME which was not set in my case. I have another computer (the same system but with JDK 1.6 x64) and it worked without JAVA_HOME variable.

You don't have to install 32 bit version of JDK :)

Solution 12 - Java

I copied the Java.exe from

> C:\Windows\System32

to

> C:\Windows\SysWOW64

and it worked.

I'm using 64 bit Windows 8.

Solution 13 - Java

This registry fix worked like a charm on my Windows 7 x64 setup: http://codearetoy.wordpress.com/2010/12/23/jdk-not-found-on-installing-android-sdk/

Solution 14 - Java

Press Report error and OK. Next will be enabled.

Solution 15 - Java

Setting the JAVA_HOME environment variable to

> C:\Program Files\Java\jdk1.7.0_07

instead of

> C:\Program Files\Java\jdk1.7.0_07\bin

fixed it for me.

Solution 16 - Java

The guy above who put this: "I experienced this problem too, but none of the answers helped. What I did, I removed the last backslash from the JAVA_HOME variable and it started working. Also, remember not to include the bin folder in the path." This was in fact the correct answer.

For this SDK to install this is what I did. I am running the latest Microsoft OS Windows 8.

User Variables:

> Path C:\Program Files\Java\jdk1.7.0_07\bin

Environment Variables

Create these two:

> CLASSPATH %HOME_JAVA%\jre\lib > > HOME_JAVA C:\Program Files\Java\jdk1.7.0_09

This one already exists so just edit:

> Path At this end of WindowsPowerShell\v1.0\ simply add ";C:\Program > Files\Java\jdk1.7.0_09"

This is what I did and it worked for me. =)

Solution 17 - Java

Try downloading and installing the zipped version rather than the .exe installer.

Solution 18 - Java

Also, RUN AS ADMINISTRATOR! Worked for me with backslash fix.

Solution 19 - Java

I had the same problem and solved it by installing the x86 version of the JDK (on Windows XP x64).

Solution 20 - Java

I had the same problem, tried all the solutions but nothing worked. The problem is with Windows 7 installed is 64 bit and all the software that you are installing should be 32 bit. Android SDK itself is 32 bit and it identifies only 32 bit JDK. So install following software.

  1. JDK (32 bit)
  2. Android SDK (while installing SDK, make sure install it in directory other than "C:\Program Files (x86)", more probably in other drive or in the directory where Eclipse is extracted)
  3. Eclipse (32 bit) and finally ADT.

I tried it and all works fine.

Solution 21 - Java

I experienced this problem too, but none of the answers helped. What I did, I removed the last backslash from the JAVA_HOME variable and it started working. Also, remember not to include the bin folder in the path.

Solution 22 - Java

Android SDK is 32 bit app, and it requires the 32 bit of JDK to work... the 64 bit JDK won't make any use for it...

Solution 23 - Java

WORKING SOLUTION AND NO REGISTRY MODIFY NEEDED

Simply put your java bin path in front of your PATH environment.

PATH before

C:\Windows\system32;C:\Windows\%^^&^&^............(old path setting)

PATH after

C:\Program Files\Java\jdk1.6.0_18\bin;C:\Windows\system32;C:\Windows\%^^&^&^............(old path setting)

And now the Android SDK installer is working.

BTW, I'm running Win7 x64.

Solution 24 - Java

1-Simply done the "JAVA_HOME" environment variable thing.

2-Right-Click on Android SDK and from compatibletiy Tab Select windows 7 and administrator.

3-Run it again.

Solution 25 - Java

Yeah install the 32 bit version of the Java SE SDK (or any of the combinations). That should help solve your problem.

Solution 26 - Java

For installer_r21.1-windows.exe on Windows 8 x 64 what worked for me was setting up my user environment variable JAVA_HOME to C:\Program Files\Java\jdk1.7.0_10. Hope this helps you all! :)

Solution 27 - Java

You will have to download the 32-bit SDK version because Win7 64-bit is not supported only Windows Server 2003 has a supported 64-bit version. During the download of Java SDK pick "Windows" as your platform and not "Windowsx64".
Once I did this android SDK installed like a charm. Hope this helps.

Solution 28 - Java

The above methods did not work for me in Windows 8 Pro.

Just set the path to

C:\Program Files\Java\jdk1.7.0_07\

Where C is your drive in which you have installed the JDK.

Don't forget the backward slash at the end.

Solution 29 - Java

I'm running a 64-bit version of Windows 7 and I was getting this issue when attempting to install Android Studio 1.0 using the executable from:

http://developer.android.com/tools/studio/index.html

I tried all the listed solutions and several different versions of JDK 1.7 and 1.8 -- no dice. I went with installing the zipped version of the application and it worked like a charm:

http://tools.android.com/download/studio/canary/latest

Still baffled by this problem; especially since beta versions of Android Studio worked just fine.

Solution 30 - Java

For Windows users:

You would set JAVA_HOME environment variable: http://wso2.org/project/wsas/java/1.1/docs/setting-java-home.html

Solution 31 - Java

I tried several posted solutions and then it took a system reboot before it started working, which may have been because I had just installed the JDK. Here are all the things I had going on - not sure which ones were essential:

  • 64-bit JDK installed.
  • JAVA_HOME defined using forward slashes (/) instead of backslashes ().
  • JDK 'bin' directory listed at beginning of PATH.
  • System reboot.

Solution 32 - Java

This issue has been fixed on SDK revision 20.xxx

Download it via http://dl.google.com/android/installer_r20.0.3-windows.exe

Solution 33 - Java

You might want to restart your machine. For me, without having to use forward slashes it worked after I restarted windows.

Solution 34 - Java

Install both JDK 64 bit 1.6 for Windows and JRE 1.7 64bit for Windows.

It worked in my case.

Solution 35 - Java

I spent a little over an hour trying just about every option presented. I eventually figured out that I had a lot of stale entries for software that I had uninstalled. I deleted all the registry nodes that had any stale data (pointed to the wrong directory). This included the

> [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Runtime > Environment]

and

> [HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment]

entries as a JRE included in the JDK.

I also got rid of all the JAVA entries in my environmental variables. I guess I blame it on bad uninstallers that do not clean up after themselves.

Solution 36 - Java

4 Different Solutions:

1) If you get above screen, just click BACK button and from previous screen click NEXT button. Actually silly, but sounds good.

2) Download SDK Manager .zip format instead of .exe and then try to install. It’s all so silly, but work like a charm.

3) If you installed 64 bit JDK means, just uninstall that and install 32-bit JDK.

4) You have to change that as following,

JAVA_HOME=C:/Program Files/Java/jdk1.8.0_11
JRE_HOME=C:/Program Files/Java/jre8
Path=%JAVA_HOME%;C:…

Solution 37 - Java

There is too many ways for doing it:

Way number one

If Java is installed perfectly in your machine, then please close the installer and try to reinstall it.

When you open it for the second time, it will find JAVA.

Way number 2

Set up an environment variable like this-

> https://stackoverflow.com/questions/1672281/environment-variables-for-java-installation/1672536#1672536

And then try again.

It should work :)

Solution 38 - Java

It is bug in the Android installer. Download the latest installer and try it. Then it will work.

Solution 39 - Java

In my case problem was in JAVA_TOOL_OPTIONS environment variable. Nothing helps me until I removed it. Hope it help someone!

Solution 40 - Java

My problem was that i run studio.exe instead of studio64.exe. I'm running Windows 8 64bits

Solution 41 - Java

For Wine users:... For reasons having to do with "unimplemented" (as in: the "find" command and the "/D" switch to "copy"), it appears that you have to cheat a bit more to get Android SDK to see JDK in Wine.

However, I have passed the hurdles and am (I suppose) obliged to share something (anything) that worked:

  1. What is responsible for finding Java is the script "tools/lib/find_java.bat". In the beginning of that file, add:

set java_exe=%JAVA_HOME%/bin/java.exe goto :EOF

  1. To circumvent the "copy /D not implemented" issue, in "tools/android.bat" comment out (with "rem") the lines from just after :MkTempCopy to just before :EndTempCopy

You should now (if you've set JAVA_HOME) be able to run android.bat and install the SDK parts you need.

Solution 42 - Java

Windows 8 running the x64 SDK.

  1. Download the latest JDK from here: Oracle JDK
  2. Once downloaded and extracted go into the JDK file at C:\Program Files\Java\jdk1.7.0_80\bin and double click on the java Application file (it's the only one called just java). This will briefly open the command line.
  3. Begin the process of installing Android Studio again, from scratch. It should automatically detect the SDK now.

For whatever reason Android Studio wouldn't detect it no matter what I put in manually or searched using the browse option.

Pressing back would not work.

Reporting the error would not work.

Adding JAVA_HOME or other suggestions to the C:... would not work.

It was only beginning the installation of Android Studio again after running the java file that it worked.

Solution 43 - Java

I have the jdk installed on my D: drive. None of the other answers worked for me. I got it to install by creating a symbolic link from the C: drive to the installed location:

    c:
    cd "Program Files"
    mklink /d Java "d:\Program Files\Java"  

Note that the jdk (and jre) install directories are subdirectories of "Java" so upgrading is not a problem even though the name changes with the release.

Solution 44 - Java

I add the following in the users Environment Variable( Windows 10)

JAVA_HOME=C:/Program Files/Java/jdk1.8.0_11
JRE_HOME=C:/Program Files/Java/jre8
Path=%JAVA_HOME%;C:...

And then cancel the current installation of Android Studio and start again. It worked fine this time for me. No JDK error.

Solution 45 - Java

While this question has already been answered. Here is what exact steps you need to do when you are setting up for development. In general anything related to Java Development.

Setting Up Java

Make sure you are using latest jdk url

curl -L -O -H "Cookie: oraclelicense=accept-securebackup-cookie" -k "http://download.oracle.com/otn-pub/java/jdk/8u60-b27/jdk-8u60-linux-x64.tar.gz"
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/jdk1.7.0_67/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/jdk1.7.0_67/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/local/jdk1.7.0_67/bin/javaws" 1
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config javaws

Setting up your system in this case ubuntu/mac

export ANDROID_HOME=/home/ashish/android-sdks
export ANDROID_SDK=/home/ashish/android-sdks
export JAVA_HOME=/usr/local/jdk1.8.0_45
export JDK_HOME=/usr/local/jdk1.8.0_45/
export JRE_HOME=/usr/local/jdk1.8.0_45/jre
export PATH=$PATH:$ANT_HOME/bin:$JAVA_HOME/bin:$JRE_HOME/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools

this contents needs to appear in .profile in ubuntu or .bash_profile in mac in home folder we can go there using cd ~

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSimonView Question on Stackoverflow
Solution 1 - JavaJurgenView Answer on Stackoverflow
Solution 2 - JavaKenton PriceView Answer on Stackoverflow
Solution 3 - JavaMichael RutView Answer on Stackoverflow
Solution 4 - JavaSimonView Answer on Stackoverflow
Solution 5 - JavagabrioView Answer on Stackoverflow
Solution 6 - JavaDaniel LeschkowskiView Answer on Stackoverflow
Solution 7 - JavaJustin BuserView Answer on Stackoverflow
Solution 8 - JavaJules ColleView Answer on Stackoverflow
Solution 9 - JavaPascaliusView Answer on Stackoverflow
Solution 10 - JavaDav.idView Answer on Stackoverflow
Solution 11 - JavaMarcin RobaszyńskiView Answer on Stackoverflow
Solution 12 - JavaugurrrrrView Answer on Stackoverflow
Solution 13 - JavaKentView Answer on Stackoverflow
Solution 14 - JavaKalpesh SoniView Answer on Stackoverflow
Solution 15 - JavaDaniel NView Answer on Stackoverflow
Solution 16 - Javauser827114View Answer on Stackoverflow
Solution 17 - JavaNickView Answer on Stackoverflow
Solution 18 - JavaklhView Answer on Stackoverflow
Solution 19 - JavaSNKView Answer on Stackoverflow
Solution 20 - JavaAnkit SaxenaView Answer on Stackoverflow
Solution 21 - JavaMikkoPView Answer on Stackoverflow
Solution 22 - JavaIWIHView Answer on Stackoverflow
Solution 23 - JavaRRTWView Answer on Stackoverflow
Solution 24 - JavaFarhadView Answer on Stackoverflow
Solution 25 - JavadokdView Answer on Stackoverflow
Solution 26 - JavatruthseekerView Answer on Stackoverflow
Solution 27 - JavaNebView Answer on Stackoverflow
Solution 28 - JavaIbn SaeedView Answer on Stackoverflow
Solution 29 - JavaJoughTheFunView Answer on Stackoverflow
Solution 30 - JavaN3CAT1View Answer on Stackoverflow
Solution 31 - JavaAbePralleView Answer on Stackoverflow
Solution 32 - JavaDeadManSpiritView Answer on Stackoverflow
Solution 33 - JavaBehnUmView Answer on Stackoverflow
Solution 34 - Javaandroid developerView Answer on Stackoverflow
Solution 35 - JavarezaView Answer on Stackoverflow
Solution 36 - JavaKarShoView Answer on Stackoverflow
Solution 37 - JavaAbrar JahinView Answer on Stackoverflow
Solution 38 - JavaSIVAKUMAR.JView Answer on Stackoverflow
Solution 39 - JavaSatView Answer on Stackoverflow
Solution 40 - JavaRenan FrancaView Answer on Stackoverflow
Solution 41 - JavaeriksoeView Answer on Stackoverflow
Solution 42 - JavaApp Dev GuyView Answer on Stackoverflow
Solution 43 - JavaZuberFowlerView Answer on Stackoverflow
Solution 44 - JavaPritiView Answer on Stackoverflow
Solution 45 - JavasilentsudoView Answer on Stackoverflow