解决导入项目工程“Execution failed for task ':lib:compileReleaseJava'的问题

问题报错:

Error:Execution failed for task ':lib:compileReleaseJava'.
> 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.遇到这些问题就是:

distributionUrl路径版本过低和classpath的版本过低,如:

在项目中的build.gradle中的依赖classpath为:

dependencies {
    classpath 'com.android.tools.build:gradle:1.0.1'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

在项目中的gradle-wrapper.properties中使用的distributionUrl为:

#Wed Jul 26 17:24:08 CST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2-all.zip

版本过低这出现上述情况。



2.解决问题:

在项目中的build.gradle中的依赖classpath版本改为2.3.1或者你其他项目中可用的版本:

dependencies {
    classpath 'com.android.tools.build:gradle:2.3.1'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

在项目中的gradle-wrapper.properties中使用的distributionUrl改为3.3或者你其他项目中可用的版本:

#Wed Jul 26 17:26:15 CST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip







  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值