Could not find org.gradle.wrapper.GradleWrapperMain

Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain

Build step 'Invoke Gradle script' changed build result to FAILURE
Build step 'Invoke Gradle script' marked build as failure
Finished: FAILURE

Solution

gradle wrapper

It will update gradlew and gradle-wrapper.properties.

Then, try to run gradlew command again.

./gradlew jar

Reference