Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio: "Gradle sync failed: Could not run JVM from the selected JDK."

Ever since installing Android Studio 3.2, I haven't been able to run Java, I have tried jdk-8u181-windows-x64, jdk-10.0.2_windows-x64_bin, jdk-11_windows-x64_bin, setting PATH and reinstalling everything umpteen times, the result is the same - no "java" appears and the error message is: -

Gradle sync failed: Could not run JVM from the selected JDK. Please ensure JDK installation is valid and compatible with the current OS (Windows 8.1 6.3, amd64). If you are using embedded JDK, please make sure to download Android Studio bundle compatible with the current OS. For example, for x86 systems please choose a 32 bits download option. (369 ms)

Notes: I used to be able to open the java folder but after playing with it too much, something went wrong, so, I decided to start afresh... and I am dead ever since.

Is Studio 3.2 flawed? Not compatible with Java at all? Or am I missing something? is there a older Android Studio I can test? Thanks for any help you may provide.

like image 226
Diddy Cool Avatar asked Oct 01 '18 04:10

Diddy Cool


2 Answers

In my case, the following solved it:

File->Other settings->Default Project Structure...

In "JDK Location", I previously had the oracle jdk selected. To fix this issue, I instead checked "Use embedded JDK (recommended)"

Android Studio JDK location setting

like image 154
Carmen Avatar answered Oct 11 '22 19:10

Carmen


Solved YES Other Settings ---> Default Project Structure ---> Uncheck Embedded jdk ( Write Your Own jdk Location )

like image 30
user11588425 Avatar answered Oct 11 '22 21:10

user11588425