gpt4 book ai didi

java - Spring.io REST 教程中的构建错误

转载 作者:行者123 更新时间:2023-11-29 05:30:39 24 4
gpt4 key购买 nike

我正在尝试学习 Spring REST 教程,但在使用教程中推荐的 gradle 构建工具时遇到了这些构建错误。

https://spring.io/guides/gs/rest-service/

感谢帮助

C:\Users\Desktop\gs-rest-service-master\gs-rest-service-master\initial>
gradlew build
Downloading http://services.gradle.org/distributions/gradle-1.8-bin.zip

Exception in thread "main" java.lang.RuntimeException: java.net.UnknownHostExcep
tion: services.gradle.org
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc
essManager.java:78)
at org.gradle.wrapper.Install.createDist(Install.java:47)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused by: java.net.UnknownHostException: services.gradle.org
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java
:178)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)
at sun.net.www.http.HttpClient.New(HttpClient.java:308)
at sun.net.www.http.HttpClient.New(HttpClient.java:326)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLC
onnection.java:996)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConne
ction.java:932)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection
.java:850)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
nection.java:1300)
at org.gradle.wrapper.Download.downloadInternal(Download.java:59)
at org.gradle.wrapper.Download.download(Download.java:45)
at org.gradle.wrapper.Install$1.call(Install.java:60)
at org.gradle.wrapper.Install$1.call(Install.java:47)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc
essManager.java:65)
... 3 more

最佳答案

错误消息是不言自明的。您的 DNS 工作不正常。 services.gradle.org 在我的机器上正确解析。

关于java - Spring.io REST 教程中的构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21195937/

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