Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to run gradlew

Tags:

gradle

gradlew

I've setup a build.gradle file with apply plugin: 'java'. I tried setting up a gradle wrapper using the instructions here, but when I type sudo ./gradlew build, I get an error sudo: ./gradlew: command not found. When I type gradle build, the project builds fine. It's just gradlew that isn't working.
I even tried sudo chmod +x gradlew but it didn't work. I'm using Fedora 20, 64 bit and gradle version 1.10.

like image 549
Nav Avatar asked Feb 06 '14 08:02

Nav


People also ask

How do I run a gradlew file?

To run a Gradle command, open a command window on the project folder and enter the Gradle command. Gradle commands look like this: On Windows: gradlew <task1> <task2> … ​ e.g. gradlew clean allTests.

Do I need Gradle to run gradlew?

1. No need to install gradle locally. The gradlew script doesn't rely on a local Gradle installation. It goes and fetches a Gradle installation from the internet the first time it runs on your local machine, and caches it.


Video Answer


1 Answers

Ok so the solution was to run gradlew on the Linux partition itself. Somehow, when I ran it from a Windows partition mounted in Linux, the file couldn't get execute permissions even though I ran chmod 777 gradlew. When I copied the project into the Linux filesystem and ran it, it worked fine (after setting execute permission for it).

like image 127
Nav Avatar answered Jan 02 '23 23:01

Nav