Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android studio not installing even if JDK 8 is installed

Tags:

java

android

I just downloaded Google's new android studio bundle(x64 for Windows) and also installed JDK8 (C:\Program Files\Java\jdk1.8.0_25) (x64 version).

But on the android studio setup it does not detect JDK and asks to locate its path. I located its path but still it says it is not valid.

I tried declaring new Environment variables (both system and User) but still I get same error.

I also tried in cmd, and it says that java & JDK is installed.

After that I reinstalled JDK 8 for windows x64 from Oracle. But no changes in android studio...

Please Help. !

like image 906
Mei Tetra Avatar asked Mar 16 '15 06:03

Mei Tetra


People also ask

Which version of JDK is compatible with Android Studio?

Set the JDK version A copy of the latest OpenJDK comes bundled with Android Studio 2.2 and higher, and this is the JDK version we recommend you use for your Android projects.

Does Android Studio automatically install JDK?

Note that installing Android Studio doesn't automatically configure the built-in JDK command line tools. This matters if you want to use the Android SDK command line tools.

Do I have to download JDK for Android Studio?

You must install Oracle JDK before installing Android Studio, so please don't start this step until you have completed Step 1 above. Download Android Studio from the following address: Android Studio Download Page.

Does installing Android Studio install Java?

Since Android's source code is in Kotlin (or Java), you'll need to install the Java Development Kit (JDK) as well. You can download it here. This installation pack contains both Android Studio and the SDK (software development kit).


3 Answers

I had the same problem. I discovered that it was caused because I installed the JDK while the Android Studio installer was still opened and at the prompt to load the location of the JDK. Closing the Android installer and then reloading it after the JDK installation had completed and was closed out, solved the installation problem for me.

like image 161
user5803922 Avatar answered Nov 08 '22 21:11

user5803922


In my case, I am using java8 and based on Doc I just had to add the following:

 implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
like image 30
Mustafa Shahoud Avatar answered Nov 08 '22 22:11

Mustafa Shahoud


While running Java 6 something I tried to install Android Studio. Android Studio did not find Java 7 or Java 8, so it asked me to install at least Java 7 and gave a link to Java 7. While the original instance of Android Studio Installer was still alive, it would not find Java 7 or 8. killing and restarting Android Studio Installer worked just fine. So install Java and restart the installer.

like image 25
user5127121 Avatar answered Nov 08 '22 22:11

user5127121