Android Studio doesn't find Java Development Kit (JDK)

12,169

Solution 1

I think your JAVA_HOME variable is set to the wrong thing. Mine is:

JAVA_HOME C:\Program Files\Java\jdk1.8.0_60

I also have a PATH variable set as follows:

PATH      %JAVA_HOME%\BIN

I do not have a JDK_HOME variable.

Try that and see if it works.

(I recently installed Android Studio and had the same problem, even though I had Java 7 installed. So I downloaded Java 8 and manually updated the JAVA_HOME variable.)

Solution 2

I had the same problem when trying to install Android Studio bundle v2.1 (143.2915827-windows) on a Windows 10 machine with a JDK at a non-standard location (the JDK on a path containing spaces). After manually selecting the path, the installer would complain that it could still not find a JDK. I solved it by manually enclosing the selected path with double quotes by typing in the editable textbox.

Share:
12,169
Francisco Romero
Author by

Francisco Romero

The best way to learn something is trying to help others to solve their issues that you have never tried before. This is the reason why I am in Stackoverflow. Now starting with web developing.

Updated on June 25, 2022

Comments

  • Francisco Romero
    Francisco Romero almost 2 years

    I have installed Java 8 on my computer but Android Studio doesn't find it. When I execute the installer of Android Studio I only can see an screen in which I can see an introduction and when I press "Next" another screen it's displayed in which says:

    We could not detect a Java Development Kit (JDK) v7 or newer on your system. Please browse to its path if known.

    So I searched my JDK and when I press the button "Next" I get the following message:

    Sorry, we still could not detect a valid JDK, which we need to proceed.

    If setting your JDK path manually, make sure you have browsed to a parent directory that contains a "bin\java.exe" whose version reports 1.7 or higher when you run "java.exe -version".

    After that, I go to the console and execute the command "java.exe -version". It gives to me:

    java version "1.8.0_60"

    So I don't know why it doesn't find my JDK. I also tried adding some Environment Variables:

    JAVA_HOME: C:\Program Files\Java\jre1.8.0_60\
    JDK_HOME: C:\Program Files\Java\jre1.8.0_60\
    

    But it still doesn't find it. How can I fix it?

    Note: I'm using Windows 10 as OS.

    Thanks in advance!

  • Francisco Romero
    Francisco Romero over 8 years
    Thanks for the point! I will see it now and answer to you if it works.
  • Francisco Romero
    Francisco Romero over 8 years
    Thank you very much! Before I didn't have the folder jdk, only the jre so I unistall Java and reinstall it again and now I put the new folder jdk on my JDK_HOME and JAVA_HOME environment variables.