无法将现有 spring 启动 gradle 应用程序导入 eclispe(版本:Mars Release (4.5.0) Build id:20150621-1200)?

Not able to import existing spring boot gradle application into eclispe(Version: Mars Release (4.5.0) Build id: 20150621-1200)?

因为我是 spring 的新手,所以遇到这个错误 当我打开现有的 gradle project.i 也尝试安装 sts,gradle buildship 等

错误:无法从 https://services.gradle.org/distributions/gradle-3.4.1-bin.zip.

安装 Gradle 发行版

堆栈跟踪:

org.gradle.tooling.GradleConnectionException: Could not install Gradle distribution from 'https://services.gradle.org/distributions/gradle-3.4.1-bin.zip'.
    at org.gradle.tooling.internal.consumer.DistributionFactory$ZippedDistribution.getToolingImplementationClasspath(DistributionFactory.java:129)
    at org.gradle.tooling.internal.consumer.loader.CachingToolingImplementationLoader.create(CachingToolingImplementationLoader.java:40)
    at org.gradle.tooling.internal.consumer.loader.SynchronizedToolingImplementationLoader.create(SynchronizedToolingImplementationLoader.java:43)
    at org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.onStartAction(LazyConsumerActionExecutor.java:101)
    at org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.run(LazyConsumerActionExecutor.java:83)
    at org.gradle.tooling.internal.consumer.connection.CancellableConsumerActionExecutor.run(CancellableConsumerActionExecutor.java:45)
    at org.gradle.tooling.internal.consumer.connection.ProgressLoggingConsumerActionExecutor.run(ProgressLoggingConsumerActionExecutor.java:58)
    at org.gradle.tooling.internal.consumer.connection.RethrowingErrorsConsumerActionExecutor.run(RethrowingErrorsConsumerActionExecutor.java:38)
    at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor.run(DefaultAsyncConsumerActionExecutor.java:55)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.StoppableExecutorImpl.run(StoppableExecutorImpl.java:46)
    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.DefaultModelBuilder.get(DefaultModelBuilder.java:50)
    at com.gradleware.tooling.toolingclient.internal.DefaultToolingClient.executeAndWait(DefaultToolingClient.java:88)
    at com.gradleware.tooling.toolingclient.internal.DefaultModelRequest.executeAndWait(DefaultModelRequest.java:79)
    at com.gradleware.tooling.toolingmodel.repository.internal.DefaultModelRepository.get(DefaultModelRepository.java:287)
    at com.gradleware.tooling.toolingmodel.repository.internal.DefaultModelRepository.executeAndWait(DefaultModelRepository.java:355)
    at com.gradleware.tooling.toolingmodel.repository.internal.DefaultModelRepository.access0(DefaultModelRepository.java:49)
    at com.gradleware.tooling.toolingmodel.repository.internal.DefaultModelRepository.call(DefaultModelRepository.java:313)
    at com.google.common.cache.LocalCache$LocalManualCache.load(LocalCache.java:4724)
    at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3522)
    at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2315)
    at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2278)
    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2193)
    at com.google.common.cache.LocalCache.get(LocalCache.java:3932)
    at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4721)
    at com.gradleware.tooling.toolingmodel.repository.internal.DefaultModelRepository.getFromCache(DefaultModelRepository.java:330)
    at com.gradleware.tooling.toolingmodel.repository.internal.DefaultModelRepository.executeRequest(DefaultModelRepository.java:309)
    at com.gradleware.tooling.toolingmodel.repository.internal.DefaultModelRepository.executeRequest(DefaultModelRepository.java:280)
    at com.gradleware.tooling.toolingmodel.repository.internal.DefaultModelRepository.fetchBuildEnvironment(DefaultModelRepository.java:113)
    at com.gradleware.tooling.toolingmodel.repository.internal.DefaultModelRepository.targetGradleVersionIsEqualOrHigherThan(DefaultModelRepository.java:247)
    at com.gradleware.tooling.toolingmodel.repository.internal.DefaultModelRepository.supportsCompositeBuilds(DefaultModelRepository.java:243)
    at com.gradleware.tooling.toolingmodel.repository.internal.DefaultModelRepository.fetchEclipseGradleProjects(DefaultModelRepository.java:202)
    at org.eclipse.buildship.core.workspace.internal.DefaultModelProvider.fetchEclipseGradleProjects(DefaultModelProvider.java:66)
    at org.eclipse.buildship.core.workspace.internal.SynchronizeGradleBuildsJob.fetchEclipseProjects(SynchronizeGradleBuildsJob.java:87)
    at org.eclipse.buildship.core.workspace.internal.SynchronizeGradleBuildsJob.synchronizeBuild(SynchronizeGradleBuildsJob.java:79)
    at org.eclipse.buildship.core.workspace.internal.SynchronizeGradleBuildsJob.runToolingApiJob(SynchronizeGradleBuildsJob.java:72)
    at org.eclipse.buildship.core.util.progress.ToolingApiJob.run(ToolingApiJob.java:73)
    at org.eclipse.buildship.core.util.progress.ToolingApiInvoker.invoke(ToolingApiInvoker.java:62)
    at org.eclipse.buildship.core.util.progress.ToolingApiJob.run(ToolingApiJob.java:70)
    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.access0(Install.java:27)
    at org.gradle.wrapper.Install.call(Install.java:75)
    at org.gradle.wrapper.Install.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.DistributionInstaller.install(DistributionInstaller.java:73)
    at org.gradle.tooling.internal.consumer.DistributionFactory$ZippedDistribution.getToolingImplementationClasspath(DistributionFactory.java:123)
    at org.gradle.tooling.internal.consumer.loader.CachingToolingImplementationLoader.create(CachingToolingImplementationLoader.java:40)
    at org.gradle.tooling.internal.consumer.loader.SynchronizedToolingImplementationLoader.create(SynchronizedToolingImplementationLoader.java:43)
    at org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.onStartAction(LazyConsumerActionExecutor.java:101)
    at org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.run(LazyConsumerActionExecutor.java:83)
    at org.gradle.tooling.internal.consumer.connection.CancellableConsumerActionExecutor.run(CancellableConsumerActionExecutor.java:45)
    at org.gradle.tooling.internal.consumer.connection.ProgressLoggingConsumerActionExecutor.run(ProgressLoggingConsumerActionExecutor.java:58)
    at org.gradle.tooling.internal.consumer.connection.RethrowingErrorsConsumerActionExecutor.run(RethrowingErrorsConsumerActionExecutor.java:38)
    at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor.run(DefaultAsyncConsumerActionExecutor.java:55)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.StoppableExecutorImpl.run(StoppableExecutorImpl.java:46)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

任何帮助将不胜感激!

似乎 Gradle 未正确下载或 .zip 文件已损坏,请参阅错误:

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)

进入分发文件夹并尝试打开 zip 文件以查看它是否已损坏。该目录应该是这样的:

~/.gradle/wrapper/dists/gradle-3.4.1-bin/hash.../gradle-3.4.1-bin.zip

如果 zip 文件已损坏,请尝试手动下载文件并将其放在同一文件夹中,然后重新启动 eclipse。

如果仍然无法正常工作,请尝试通过删除主目录和项目目录中的 .gradle 文件夹来删除所有 Gradle 缓存。