解决: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 SystemJavaCompiler. 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)》

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

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

    原文作者:shenshizhong
    原文地址: https://www.jianshu.com/p/b3de5849ecca
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞