7

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
  • 12,787
  • 22
  • 92
  • 167
  • `JDK_HOME: C:\Program Files\Java\jre1.8.0_60` is there a typo? You have set `jdk` path to `jre` folder – wasyl Sep 23 '15 at 22:33
  • I saw JDK_HOME here: http://stackoverflow.com/questions/16574189/android-studio-installation-on-windows-7-fails-no-jdk-found – Francisco Romero Sep 23 '15 at 22:37
  • 1
    but you point to `JRE1.8..` folder. You should install Java 8 Development Kit, not Java 8 Runtime Environment. These are two different things – wasyl Sep 23 '15 at 22:39
  • @wasyl I will look at it now and I answer to you if it works. Thanks for the point! – Francisco Romero Sep 23 '15 at 22:41
  • @wasyl Thank you very much! Reinstalling Java the folder `jdk` appeared and I could point to it in my `JAVA_HOME` and `JDK_HOME`. – Francisco Romero Sep 24 '15 at 01:37

4 Answers4

2

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.)

starblazer
  • 46
  • 2
  • Thanks for the point! I will see it now and answer to you if it works. – Francisco Romero Sep 23 '15 at 22:41
  • 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. – Francisco Romero Sep 24 '15 at 01:36
1

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.

madanasta
  • 119
  • 5
0

This drove me nuts for a couple of days. I was not able to resolve the issue through the Android studio installer, but found a workaround:

  • Go to http://developer.android.com/sdk/index.html
  • Instead of downloading "Android Studio package" (the exe file), scroll down and select "SDK tools package" (the zip file).
  • This work perfectly and allows you to select all the packages you want to download, including the packages installed by the installer.
-1

What worked for me. I recieved the same error message and went to directly install the java, without closing the installation of Android studio. then tried to find the path. so I closed out the window for Android Studio and Reopened the download file and it automatically detected it. This might not work for everyone but worth a try. easier then messing with everthing else.

Justin
  • 1