在Android studio 中導(dǎo)入其他項(xiàng)目,運(yùn)行時報以下錯誤:
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、導(dǎo)入的項(xiàng)目的JDK Location 和本地的JDK Location不一致,導(dǎo)致找不到此項(xiàng)目的JDK Location
2、導(dǎo)入的項(xiàng)目之前配置的Gradle版本過低
解決方法:1、File——>Project Structure——>SDK Location——>JDK Location ?操作如下:
? ? ? ? ? ? ? ? ? ? ? 2、更新Gradle版本