美文网首页
Android studio 导入其他项目找不到JDK和JAVA

Android studio 导入其他项目找不到JDK和JAVA

作者: 淡雅如兰_往事随风 | 来源:发表于2018-03-21 17:38 被阅读0次

在Android studio 中导入其他项目,运行时报以下错误:

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

> 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、导入的项目的JDK Location 和本地的JDK Location不一致,导致找不到此项目的JDK Location

2、导入的项目之前配置的Gradle版本过低

解决方法:1、File——>Project Structure——>SDK Location——>JDK Location  操作如下:

                      2、更新Gradle版本

相关文章

网友评论

      本文标题:Android studio 导入其他项目找不到JDK和JAVA

      本文链接:https://www.haomeiwen.com/subject/ghagqftx.html