1

I can't install Android Studio because when I start the installation,
it can't detect a JDK. When I set manually the path (C:\Program Files\Java\jdk1.7.0_79) and click Next, it says that he still could not detect a valid JDK. I have done what it asks: verify the version with java.exe -version and this is OK, I have a good version (1.7). I have also try with a 1.8 version, but it didn't work either.

I have tried everything I've found :

  • set the environment variables : JAVA_HOME and JDK_HOME to "C:\Program Files\Java\jdk1.7.0_79" and PATH to "C:\Program Files\Java\jdk1.7.0_79\bin" (and I have placed it before "C:\Windows\System32")

  • uninstall all JDK and reinstall just one.

  • I have verified that my configuration matches the minimum system requirements (and it's OK).

  • The Virtualization Technology is enabled.

And I need to mention that I had Android Studio installed on my computer (it worked perfectly, and I didn't had any problem to install it the first time) but I had to uninstall it. I did it properly (with the "uninstall a program" in the control panel). After that, before trying to reinstall it, I have empty the trash and clean the registry with CCleaner.

Thanks in advance for your answers :)

Tom Harrison
  • 13,533
  • 3
  • 49
  • 77
Rambo
  • 21
  • 7
  • 2
    very good question, fully explained :) – niceman Apr 22 '16 at 13:11
  • i think your JDK is not properly installed, you should reinstall JDK and then install Android Studio, I often install reinstall Android Studio but I had never faced this issue. – Atiq Apr 22 '16 at 13:15
  • @Anders hmmm OP stated he uninstalled all JDK and installed just one, could it be a permission issue ? – niceman Apr 22 '16 at 13:16
  • 1
    Yes, congratulations for your patience in explaining all the scenario. I would suggest you to down a brand new copy of A.S. installation package. Maybe the matter you're facing relates with an old A.S. version confliting with a new version of JDK. Try this: unninstall all; install the newest JDK; do a full restart of Windows; install the newest A.S. Hope you solve this soon. @niceman is right, check about permissions. – statosdotcom Apr 22 '16 at 13:19
  • No I don't think its permissions issue, have you tried solution on [this](http://stackoverflow.com/questions/16574189/android-studio-installation-on-windows-7-fails-no-jdk-found?rq=1) page? there are multiple on there – Atiq Apr 22 '16 at 13:21
  • @Anders I have tried to uninstall/reinstall but it didn't worked and also none of the solutions of the page you give me worked. Each time I have the same problem. – Rambo Apr 22 '16 at 15:17
  • @statosdotcom I have tried this twice (I have downloaded the latest versions on the official website) but it didn't worked. I have always the same problem. I have also checked the permissions and I don't think it's the problem. And one more thing : when I do (in cmd.exe) "where java", it displays the right path "C:/Program Files/Java/jdk1.8.0_92/bin/java.exe" – Rambo Apr 22 '16 at 15:20

2 Answers2

2

I had the same issue once. It was due to the fact that I had a x64 version of JDK and x32 version of Android Studio. Check that you are using the same version of those and it's the correct version for your OS.

Aurasphere
  • 3,841
  • 12
  • 44
  • 71
  • How can I know if the link on the official website to download A.S. is in x32 or x64 ? There is no specification about that. My OS and my JDK are in x64. – Rambo Apr 22 '16 at 15:05
  • I checked on the website and it seems that now Android Studio comes only on one version. If you are still having the same issue, could you try using a JDK 7 instead of 8? – Aurasphere Apr 22 '16 at 19:06
  • I have already tried with both versions of JDK and it didn't work. I have the same error. – Rambo Apr 25 '16 at 07:08
  • Which version of Windows are you using? – Aurasphere Apr 25 '16 at 10:55
  • I use Windows 7 Enterprise. – Rambo Apr 25 '16 at 11:23
  • This is very strange... I'd suggest you to uninstall both the JDK and AS once more and reinstall them with right click -> Run as Administrator... Let me know if that does anything... – Aurasphere Apr 25 '16 at 12:00
  • I have already do that, but I did it one more time and it does nothing. – Rambo Apr 25 '16 at 12:48
  • When you have to set the path of JDK are you doing it manually or are you using the Browse... button? To which directory are you pointing? – Aurasphere Apr 25 '16 at 13:42
  • I use the browse button and the path is : C:\Program Files\Java\jdk1.8.0_91 – Rambo Apr 25 '16 at 13:54
  • Can you try doing java -version on command prompt and write back the output? Thank you. – Aurasphere Apr 25 '16 at 15:13
1

I have found an alternative solution to my problem:

  • download and install IntelliJ IDEA (the IDE): https://www.jetbrains.com/idea/

  • download and install android SDK tools package (not Android Studio).

  • download and install the latest JDK (or at least a 1.7 version).

  • download Gradle (binary): http://gradle.org/gradle-download/

  • run the SDK manager as an Administrator (in C:/Program Files/Android/android-sdk) and install the default packages.

  • run IntelliJ IDEA (as an Administrator) and on the bottom right corner click on Configure -> Project Defaults -> Project Structure. On the left panel, go to SDKs and add (with the + sign) JDK (select the JDK folder. It's "jdk1.8.0_11" for me and usually it's in C:/Program Files/Java). Also add Android SDK (C:/Program Files/Android/android-sdk). Click on Apply and OK.

  • create a new project.

  • to resolve errors with Gradle, go to File -> Settings. On the left panel, go to Build, Execution, Deployment -> Build Tools -> Gradle. Select "Use local gradle distribution" (and set the path of gradle). Check the box "Offline work".

Rambo
  • 21
  • 7