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

有时候我们下载的项目运行会报此错误
解决方法如下:
在moudle的build.gradle中将classpath修改为下行即可

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        //将classpath修改为下行即可
        classpath 'com.android.tools.build:gradle:2.3.3'
    }
}

修改之后运行会如下错


错误如图

不要紧张点击蓝色英文,等IDE自己下载完成就可以了。

你可能感兴趣的:(Cannot find System Java Compiler. Ensure that you have installed a JDK (not just a JRE))