Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle Command Not Found

So I recently made the jump from Ant to Gradle and it is wonderful. However, I am having some issues getting gradle to run from a server.

I have a script that I can manually execute to run all of my gradle tasks to build my app. This works perfectly when I am logged into the machine. The problem is that I am now trying to kick off that script for a nightly build. And in order to kill two birds with one stone I launched a JBoss server with a custom service to call that script nightly and call the script with a specific hooks from GitHub.

Does anyone know what the difference would be between calling the script when I am logged into the machine and having a server (which I started when I was logged in) call the same script?

The only information I get from the console:

    gradle: command not found
like image 843
cain4355 Avatar asked May 04 '16 05:05

cain4355


1 Answers

As say @TobiSH First of all check your environment echo $GRADLE_HOME && echo $PATH

Path to gradle can be setting up only for your user and not for all system

.profile or .bashrc instead of /etc/environment (for linux systems)

Second option is try to use gradle wrapper

$ gradle wrapper

to be more independent from your environment

You can read more about different user and system variable here (windows)

For ubuntu and other linux based systems here

like image 100
Batiaev Avatar answered Oct 19 '22 23:10

Batiaev