gradlew build --- command not found 和 caused by:java.net.SocketTimeoutException:Read time out

问题:

I am working on a Java project with gradlew. I use Ubuntu Linux as my OS. When I run “gradle” it runs, and gives me info. But when I run “gradlew”, it outputs as “No command ‘gradlew’ found, did you mean: Command ‘gradle’ from package ‘gradle’ (universe) gradlew: command not found”

解决办法:

第一步:解决command not found
Gradle wrapper needs to be built. Try running gradle wrapper --gradle-version 2.13 Remember to change 2.13 to your gradle version number. After running this command, you should see new scripts added to your project folder. You should be able to run the wrapper with ./gradlew build to build your code. Please refer to this guid for more information https://spring.io/guides/gs/gradle/.
第二步:
继续执行 ./gradlew build 还超时,最后发现竟然是我的网络不好。

备注:
以为修改gradle-wrapper-properities文件中的 distributionUrl=https://services.gradle.org/distributions/gradle-6.4.1-bin.zip 为本地下载的路径,结果显示,还是从该网站下载,所以修改这个对我无用。

参考网站:

1、https://stackoverflow.com/questions/41700798/gradlew-command-not-found
2、下载gradle网址:https://pan.baidu.com/s/1IQubwEwIYfAhDMBS3vii-w

你可能感兴趣的:(Java)