16

Every time I execute a gradle command on Mac I get a message saying:

"This build could be faster, please consider using the Gradle Daemon: https://docs.gradle.org/2.10/userguide/gradle_daemon.html"

I've created a gradle.properties file with the line org.gradle.daemon=true as mentioned in the web page given in the message. However no matter what I do, I still continue to get that message.

If I execute the command

gradle --daemon

then it executes successfully, but still next time I do something I get that message about it could be faster and builds are just as slow as before I started the daemon.

My installation directory is no /Users/username as in gradle_daemon.html as I'm falling a Udacity course (https://www.udacity.com/course/viewer#!/c-ud867/) and they recommend installing it to /usr/local/gradle

How can I actually get the gradle dameon to work and get rid of that could be faster message?

(Using Gradle version 2.10)

Will
  • 24,082
  • 14
  • 97
  • 108
Gruntcakes
  • 37,738
  • 44
  • 184
  • 378

2 Answers2

29

just put

org.gradle.daemon=true

in the ~/.gradle/gradle.properties file. Then each build on your machine will use the gradle wrapper and the message dissapears.

Rene Groeschke
  • 27,999
  • 10
  • 69
  • 78
  • 4
    `~/.gradle/gradle.properties` doesn't exists, create it `echo 'org.gradle.daemon=true' > ~/.gradle/gradle.properties` – Kunal B. Dec 30 '16 at 22:24
  • Sadly this does not help in the case that the gradle daemon shall run on demand in a project iff there already is a daemon which is usable (so the project must not start something long running at all cost, as this shall be controlled elsewhere). Running `./gradlew --foreground` forks a daemon, but this one is never used. So apparently this command is completely useless. – Tino Jul 29 '17 at 09:24
6

The page doesn't say anywhere that gradle must be installed in /Users/username. It says that this directory is your home directory, and that's where the .gradle/gradle.properties file must be located. The place where gradle is installed is irrelevant.

JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255