Reputation: 51049
I see the following info in Eclipse package explorer:
Is it possible to change this location?
Upvotes: 48
Views: 71660
Reputation: 553
What worked for me was to edit my Windows environment variables and add variable GRADLE_USER_HOME with value d:/.gradle
. (Replace "d:/.gradle" with the path to your gradle home.) Then exit and restart Eclipse.
Upvotes: 5
Reputation: 57163
You can change the cache location since gradle 3.5. This is controlled in settings.gradle file for your project:
buildCache {
local {
// Set local build cache directory.
directory = "${settingsDir}/build-cache"
}
}
thanks to Hubert Klein Ikkink, a.k.a. mrhaki.
Upvotes: 15
Reputation: 51
You can change the location of gradle cache location in eclipse by setting the eclipse gradle preference
In Eclipse open, window-> preferences Search for 'Gradle' set 'Gradle User Home' to your preferred location Click Apply/ok
Now for the changes to take effect, you might have to do Gradle-> Refresh Gradle Project
Upvotes: 5
Reputation: 1215
Globally you can set
[...] Gradle user home directory (defined by the “GRADLE_USER_HOME” environment variable, which [...] defaults to USER_HOME/.gradle) [...]
Otherwise for every build manually:
-g, --gradle-user-home Specifies the Gradle user home directory. The default is the .gradle directory in the user's home directory.
See https://gradle.org/docs/current/userguide/gradle_command_line.html.
Upvotes: 69
Reputation: 13466
You can't change the location of the cache specifically, but you can change the Gradle user home directory (the .gradle directory) which the cache is located in by using the -g
command line argument.
Upvotes: 2