gpt4 book ai didi

java - Eclipse gradle插件导入项目出错

转载 作者:行者123 更新时间:2023-12-02 02:56:30 25 4
gpt4 key购买 nike

我正在尝试使用 eclipse 插件“buildship”导入 gradle 项目。在 eclipse 导入结束时抛出此错误。

Synchronize Gradle projects with workspace failed due to an error connecting to the Gradle build.
Could not run build action using Gradle distribution

'https://services.gradle.org/distributions/gradle-3.3-bin.zip'.

Could not determine the class-path for class org.gradle.tooling.internal.consumer.connection.InternalBuildActionAdapter.
java.net.URISyntaxException: Illegal character in path at index 16: file:/C:/Eclipse Neon/plugins/org.gradle.toolingapi_3.4.0.v20170220163122.jar
Illegal character in path at index 16: file:/C:/Eclipse Neon/plugins/org.gradle.toolingapi_3.4.0.v20170220163122.jar
org.gradle.tooling.GradleConnectionException: Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-3.3-bin.zip'.
at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:55)
at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:29)
at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:41)
at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.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.DefaultBuildActionExecuter.run(DefaultBuildActionExecuter.java:48)
at com.gradleware.tooling.toolingclient.internal.DefaultToolingClient.executeAndWait(DefaultToolingClient.java:106)
at com.gradleware.tooling.toolingclient.internal.DefaultBuildActionRequest.executeAndWait(DefaultBuildActionRequest.java:51)
at com.gradleware.tooling.toolingmodel.repository.internal.DefaultModelRepository$13.get(DefaultModelRepository.java:287)
at com.gradleware.tooling.toolingmodel.repository.internal.DefaultModelRepository.executeAndWait(DefaultModelRepository.java:355)
at com.gradleware.tooling.toolingmodel.repository.internal.DefaultModelRepository.access$100(DefaultModelRepository.java:49)
at com.gradleware.tooling.toolingmodel.repository.internal.DefaultModelRepository$14.call(DefaultModelRepository.java:313)
at com.google.common.cache.LocalCache$LocalManualCache$1.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.fetchEclipseGradleProjects(DefaultModelRepository.java:238)
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$1.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: org.gradle.api.GradleException: Could not determine the class-path for class org.gradle.tooling.internal.consumer.connection.InternalBuildActionAdapter.
at org.gradle.tooling.internal.provider.serialization.ClasspathInferer.find(ClasspathInferer.java:143)
at org.gradle.tooling.internal.provider.serialization.ClasspathInferer.getClassPathFor(ClasspathInferer.java:61)
at org.gradle.tooling.internal.provider.serialization.ClientSidePayloadClassLoaderRegistry$1.visitClass(ClientSidePayloadClassLoaderRegistry.java:78)
at org.gradle.tooling.internal.provider.serialization.WellKnownClassLoaderRegistry$1.visitClass(WellKnownClassLoaderRegistry.java:65)
at org.gradle.tooling.internal.provider.serialization.PayloadSerializerObjectOutputStream.writeClassLoader(PayloadSerializerObjectOutputStream.java:63)
at org.gradle.tooling.internal.provider.serialization.PayloadSerializerObjectOutputStream.writeClass(PayloadSerializerObjectOutputStream.java:55)
at org.gradle.tooling.internal.provider.serialization.PayloadSerializerObjectOutputStream.writeClassDescriptor(PayloadSerializerObjectOutputStream.java:43)
at java.io.ObjectOutputStream.writeNonProxyDesc(Unknown Source)
at java.io.ObjectOutputStream.writeClassDesc(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at org.gradle.tooling.internal.provider.serialization.PayloadSerializer.serialize(PayloadSerializer.java:45)
at org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.java:121)
at org.gradle.tooling.internal.provider.DefaultConnection.run(DefaultConnection.java:208)
at org.gradle.tooling.internal.consumer.connection.CancellableConsumerConnection$CancellableActionRunner.run(CancellableConsumerConnection.java:99)
at org.gradle.tooling.internal.consumer.connection.AbstractConsumerConnection.run(AbstractConsumerConnection.java:62)
at org.gradle.tooling.internal.consumer.DefaultBuildActionExecuter$1.run(DefaultBuildActionExecuter.java:59)
at org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.run(LazyConsumerActionExecutor.java:79)
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$1$1.run(DefaultAsyncConsumerActionExecutor.java:55)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.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)
Caused by: org.gradle.internal.UncheckedException: java.net.URISyntaxException: Illegal character in path at index 16: file:/C:/Eclipse Neon/plugins/org.gradle.toolingapi_3.4.0.v20170220163122.jar
at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:45)
at org.gradle.internal.classloader.ClasspathUtil.getClasspathForClass(ClasspathUtil.java:88)
at org.gradle.tooling.internal.provider.serialization.ClasspathInferer.find(ClasspathInferer.java:92)
... 27 more
Caused by: java.net.URISyntaxException: Illegal character in path at index 16: file:/C:/Eclipse Neon/plugins/org.gradle.toolingapi_3.4.0.v20170220163122.jar
at java.net.URI$Parser.fail(Unknown Source)
at java.net.URI$Parser.checkChars(Unknown Source)
at java.net.URI$Parser.parseHierarchical(Unknown Source)
at java.net.URI$Parser.parse(Unknown Source)
at java.net.URI.<init>(Unknown Source)
at java.net.URL.toURI(Unknown Source)
at org.gradle.internal.classloader.ClasspathUtil.getClasspathForClass(ClasspathUtil.java:74)
... 28 more

在 eclipse 上导入项目之前,我执行“gradle eclipse”命令,一切顺利。

我能做什么?

谢谢。

最佳答案

Gradle 3.4 版本之前存在一个错误(?),构建路径中不允许有空格 https://github.com/gradle/gradle/issues/1180

由于“Eclipse Neon”,您的构建路径包含空格,因此它将失败。

建议:

  • 更新到最新版本
  • 或者尝试通过移动 eclipse neon 安装来防止错误,使路径不包含空格

关于java - Eclipse gradle插件导入项目出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42975748/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com