eclipse gradle插件 org.gradle.tooling.GradleConnectionException: Could not install Gradle distribution

Posted 得意莫骄傲,失意莫沮丧。

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了eclipse gradle插件 org.gradle.tooling.GradleConnectionException: Could not install Gradle distribution相关的知识,希望对你有一定的参考价值。

eclipse安装gradle后出现如下异常:

 

org.gradle.tooling.GradleConnectionException: Could not install Gradle distribution from \'https://services.gradle.org/distributions/gradle-3.4-bin.zip\'.
    at org.gradle.tooling.internal.consumer.DistributionFactory$ZippedDistribution$1.call(DistributionFactory.java:145)
    at org.gradle.tooling.internal.consumer.DistributionFactory$ZippedDistribution$1.call(DistributionFactory.java:133)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)
    at org.gradle.tooling.internal.consumer.DefaultBuildLauncher.run(DefaultBuildLauncher.java:77)
    at com.gradleware.tooling.toolingclient.internal.DefaultToolingClient.executeAndWait(DefaultToolingClient.java:124)
    at com.gradleware.tooling.toolingclient.internal.DefaultBuildLaunchRequest.executeAndWait(DefaultBuildLaunchRequest.java:49)
    at org.eclipse.buildship.ui.wizard.project.ProjectCreationWizard$NewGradleProjectInitializer.run(ProjectCreationWizard.java:292)
    at org.eclipse.buildship.core.projectimport.ProjectPreviewJob.runToolingApiJobInWorkspace(ProjectPreviewJob.java:73)
    at org.eclipse.buildship.core.util.progress.ToolingApiWorkspaceJob$1.run(ToolingApiWorkspaceJob.java:79)
    at org.eclipse.buildship.core.util.progress.ToolingApiInvoker.invoke(ToolingApiInvoker.java:62)
    at org.eclipse.buildship.core.util.progress.ToolingApiWorkspaceJob.runInWorkspace(ToolingApiWorkspaceJob.java:76)
    at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:39)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(Unknown Source)
    at java.util.zip.ZipFile.<init>(Unknown Source)
    at java.util.zip.ZipFile.<init>(Unknown Source)
    at org.gradle.wrapper.Install.unzip(Install.java:215)
    at org.gradle.wrapper.Install.access$600(Install.java:27)
    at org.gradle.wrapper.Install$1.call(Install.java:75)
    at org.gradle.wrapper.Install$1.call(Install.java:48)
    at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69)
    at org.gradle.wrapper.Install.createDist(Install.java:48)
    at org.gradle.tooling.internal.consumer.DistributionFactory$ZippedDistribution$1.call(DistributionFactory.java:139)
    at org.gradle.tooling.internal.consumer.DistributionFactory$ZippedDistribution$1.call(DistributionFactory.java:133)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)


 

解决办法:从https://services.gradle.org/distributions/gradle-3.4-bin.zip 下载压缩包并存放到本地 我的存放到了:C:\\software_dev\\gradle-3.4下

在eclipse中配置如下:windows-->perfermance--》gradle,然后重新新建项目即可。

 

 

以上是关于eclipse gradle插件 org.gradle.tooling.GradleConnectionException: Could not install Gradle distribution的主要内容,如果未能解决你的问题,请参考以下文章

Eclipse安装Gradle插件

Eclipse安装Gradle插件

如何在eclipse中添加gradle插件

如何在 Eclipse Buildship 插件中运行“gradle init”任务?

Gradle的安装与配置+eclipse里安装Gradle插件

找不到方法'org.gradle.api.tasks.compile.CompileOptions