在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版本