How to resolve java.lang.ClassNotFoundException: org.gradle.wrapper.GradleWrapperMain error?

左心房为你撑大大i 提交于 2020-03-16 19:33:52

问题


we are trying to deploy code to a FRC robot with VScode, but we keep getting the error:

Error: Could not find or load main class
org.gradle.wrapper.GradleWrapperMain
Caused by: java.lang.ClassNotFoundException:
org.gradle.wrapper.GradleWrapperMain
The terminal process terminated with exit code: 1

we have found that other people have also gotten similar errors, but none of their solutions have helped us. We would really appreciate any help resolving this error Thanks


回答1:


I assume you are using the Gradle wrapper script (gradlew on the command line). This script relies on two other files:

gradle/wrapper/gradle-wrapper.jar
gradle/wrapper/gradle-wrapper.properties

My guess is that the jar file is missing or corrupt. You can try regenerating them by downloading Gradle manually and then running gradle wrapper (note the missing 'w') in the same folder. If this is code you are maintaining in a version control repository (e.g. Git), make sure to add and commit these two files to the repository.



来源:https://stackoverflow.com/questions/57881202/how-to-resolve-java-lang-classnotfoundexception-org-gradle-wrapper-gradlewrappe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!