Coder Perfect

Not finding the gradlew command?

Problem

Gradlew is helping me with a Java project. My operating system is Ubuntu Linux. When I run “gradle,” it executes and provides me with information. “No command ‘gradlew’ found, did you mean: Command ‘gradle’ from package ‘gradle’ (universe) gradlew: command not found,” it says when I run “gradlew.”

I done my homework, installed jdk, and installed gradle with sudo apt-get install gradle. I’m completely clueless.

Asked by Hayden

Solution #1

Just running, as mentioned in the comments, isn’t enough.

./gradlew

It was effective for me. Because it isn’t in the path, the./ tells it to look in the current directory.

.\gradlew

Answered by Suragch

Solution #2

Gradle wrapper must be created. Run gradle wrapper —gradle-version 2.13 to see what happens. Remember to replace 2.13 with the version number of your Gradle. You should see new scripts in your project folder after running this command. You should be able to build your code using the wrapper with./gradlew build. More information can be found here: https://spring.io/guides/gs/gradle/.

Answered by Alex Wilson

Solution #3

Because file characteristics can change when transferring from one OS to another, I use chmod 755 gradlew to run this bash script (Windows, Linux and Mac).

Answered by Ayman Mahgoub

Solution #4

If you’re using a Mac, try granting gradlew root access by typing

chmod +x ./gradlew

Answered by Pankaj Gaikar

Solution #5

I’m having the same issue… I use the following command to check the permissions of the wrx file: -rw-rw-r— $ls -l./gradlew (no execute permission)

So I used the command $chmod +x./gradlew to address the problem.

Answered by shanwu

Post is based on https://stackoverflow.com/questions/41700798/gradlew-command-not-found