解决:Cannot find System Java Compiler. Ensure that you have installed a JDK (not just a JRE)

导入github上的项目,有时候,就会报如下的错误

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.


解决方案:

1、直接修改版本号如下

 解决:Cannot find System Java Compiler. Ensure that you have installed a JDK (not just a JRE)

 修改后如下图:

解决:Cannot find System Java Compiler. Ensure that you have installed a JDK (not just a JRE)

2、然后出现下面的提示,直接点击就可以

解决:Cannot find System Java Compiler. Ensure that you have installed a JDK (not just a JRE)


ps:欢迎关注

 解决:Cannot find System Java Compiler. Ensure that you have installed a JDK (not just a JRE)公众号:android_dkx

我的博客:http://blog.csdn.NET/shenshizhong

我的简书:http://www.jianshu.com/users/345daf0211ad/latest_articles