-2

In android studio i'm getting this error while running the project.

Error:Execution failed for task ':app:compileDebugJava'.

Cannot find System Java Compiler. Ensure that you have installed a JDK (not just a JRE) and configured your JAVA_HOME system variable to point to the according directory.

chandu
  • 63
  • 6
  • Possible duplicate of [Android Studio installation on Windows 7 fails, no JDK found](http://stackoverflow.com/questions/16574189/android-studio-installation-on-windows-7-fails-no-jdk-found) – Akash Dubey Apr 05 '17 at 04:51
  • your ans [here](http://stackoverflow.com/a/38735609/7676637) – AwaisMajeed Apr 05 '17 at 04:52
  • 2
    One of these questions where the question itself contains already the answer. Make it a habit to actually read and understand error messages. This helps a lot! – Henry Apr 05 '17 at 04:54
  • Answer = > `Ensure that you have installed a JDK (not just a JRE) ....` – oldcode Apr 05 '17 at 04:57

5 Answers5

2

First you set JAVA_HOME variable in system environment variables. Means MyComputer Properties => Advanced System settings => Environment variables => System Variables add new variable, variable name JAVA_HOME and value jdk installation path like C:\Program Files\Java\jdk1.7.0_79

Pravin Suthar
  • 1,403
  • 1
  • 14
  • 25
0

Its written there

Ensure that you have installed a JDK (not just a JRE) and configured your JAVA_HOME system variable to point to the according directory.

AwaisMajeed
  • 2,254
  • 2
  • 10
  • 25
0

You need to install Jdk in the system and mention the path in studio by clicking the following File->Project Structure->SDK location -> JDK location

sravs
  • 330
  • 2
  • 14
0

Go to File->Other Settings->Default Project Structure->SDKs. Then change or set the JDK home path.

Fathima km
  • 2,539
  • 3
  • 18
  • 26
0

Go through the steps and and check if jdk is configured if not do so....

enter image description here

Renats Stozkovs
  • 2,549
  • 10
  • 22
  • 26