Android Studio does not find Java Development Kit (JDK)

I installed Java 8 on my computer, but Android Studio does not find it. When I run the Android Studio installer, I only see a screen on which I can see the introduction, and when I click “Next” another screen on which it appears that says:

We were unable to locate the Java Development Kit (JDK) v7 or later on your system. Please go to his path, if known.

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

Sorry, we still could not find a valid JDK, which we need to continue.

If you install your JDK path manually, make sure you look at the parent directory containing "bin \ java.exe", whose version version is 1.7 or higher when running "java.exe -version".

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

java version "1.8.0_60"

Therefore, I do not know why he did not 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 he still does not find it. How can i fix this?

Note. I use Windows 10 as an OS.

Thanks in advance!

+5
source share
4 answers

I think your JAVA_HOME variable is not configured correctly. My:

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

I also have a PATH variable as follows:

 PATH %JAVA_HOME%\BIN 

I do not have the JDK_HOME variable.

Try it and see if it works.

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

+2
source

I had the same problem when trying to install the Android Studio v2.1 package (143.2915827-windows) on a Windows 10 machine with the JDK in a non-standard location (JDK in a path containing spaces). After manually selecting the path, the installer will complain that he still will not be able to find the JDK. I solved this by manually including the selected path with double quotes by typing in an editable text box.

+1
source

It made me dunk a couple of days. I could not solve the problem through the Android studio installer, but found a workaround:

  • Go to http://developer.android.com/sdk/index.html
  • Instead of downloading the “Android Studio package” (exe file), scroll down and select “SDK toolkit” (zip file).
  • This work is perfect and allows you to select all the packages that you want to download, including packages installed by the installer.
0
source

What worked for me. I got the same error message and immediately installed java without closing the Android studio installation. then tried to find a way. so I closed the window for Android Studio and opened the download file again and it automatically detected it. This may not work for everyone, but worth a try. easier than messing around with everything else.

-1
source

Source: https://habr.com/ru/post/1232149/


All Articles