Android studio导入项目的时候报错:Error:Execution failed for task ':app:compileDebugJava'. > Cannot find Syste

今天从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.

但是打开别的项目都是好的。。。查了一下:解决办法:

File-->Project-->Structrue-->SDK Location-->JDK location 

Use embedded JDK 前面勾去掉,指定一个JDK地址。

运行还是不行的话。请看原因二:

你要导入项目的gradle版本不对,要么过高要么过低,建议将gradle版本改为新建项目的gradle版本

我的原因是因为这个。。。
重新运行就可以了。
每日语录:
在你还没有足够强大、足够优秀时,先别花太多宝贵的时间去社交,多花点时间读书、提高专业技能。放弃那些无用的社交,提升自己,你的世界才能更大。加油。。。

单曲循环《You can trust in me》

猜你喜欢

转载自blog.csdn.net/androidzmm/article/details/78605567