我用Tomcat 8创建了一个简单的本地文件服务器,并存储了gradle的发行版。我计划使用gradle包装器从本地文件服务器下载gradle,因为从这里的官方站点下载速度很慢。我可以在浏览器中从文件服务器下载文件,但我遇到了一些问题。我使用Tomcat和HTTP协议。当我指定URL并开始下载时,Android Studio会给我一个错误:
Exception in thread "main" java.lang.RuntimeException: java.io.IOException: Server returned HTTP response code: 500 for URL: http://yy.phiwifi.com/share/distributions/gradle-2.11-all.zip
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.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:48)
Caused by: java.io.IOException: Server returned HTTP response code: 500 for URL: http://yy.phiwifi.com/share/distributions/gradle-2.11-all.zip
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1840)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
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(ExclusiveFileAccessManager.java:65)
... 3 more
我不知道原因,我想也许是协议,我应该使用https,所以我改变协议并再次尝试,但它仍然无法正常工作。任何人都可以帮助我吗?