gradle java jdk linux path
export PATH=$PATH:. export JAVA_HOME=/home/x/Documents/software/jdk-12.0.1 export PATH=$PATH:${JAVA_HOME}/bin export GRADLE_HOME=/home/x/Documents/software/gradle-5.4.1 export PATH=$PATH:${GRADLE_HOME}/bin export GRADLE_USER_HOME=/home/x/Documents/gradlecache
CLASSPATH
windows .;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar
linux .:$JAVA_HOME\lib\dt.jar:$JAVA_HOME\lib\tools.jar
gradleHomeDir |
The Gradle home directory, if any. This directory is the directory containing the Gradle distribution executing this build. |
gradleUserHomeDir |
The Gradle user home directory. This directory is used to cache downloaded resources, compiled build scripts and so on. |
GRADLE_USER_HOME
-
Specifies the Gradle user home directory (which defaults to
$USER_HOME/.gradle
if not set).
The Gradle user home directory ($USER_HOME/.gradle
by default) is used to store global configuration properties and initialization scripts as well as caches and log files. It is roughly structured as follows:
├── caches │ ├── 4.8 │ ├── 4.9 │ ├── ⋮ │ ├── jars-3 │ └── modules-2 ├── daemon │ ├── ⋮ │ ├── 4.8 │ └── 4.9 ├── init.d │ └── my-setup.gradle ├── jdks │ ├── ⋮ │ └── jdk-14.0.2+12 ├── wrapper │ └── dists │ ├── ⋮ │ ├── gradle-4.8-bin │ ├── gradle-4.9-all │ └── gradle-4.9-bin └── gradle.properties
Cleanup of caches and distributions
From version 4.10 onwards, Gradle automatically cleans its user home directory. The cleanup runs in the background when the Gradle daemon is stopped or shuts down. If using --no-daemon
, it runs in the foreground after the build session with a visual progress indicator.
The following cleanup strategies are applied periodically (at most every 24 hours):
-
Version-specific caches in
caches/<gradle-version>/
are checked for whether they are still in use.If not, directories for release versions are deleted after 30 days of inactivity, snapshot versions after 7 days of inactivity. -
Shared caches in
caches/
(e.g.jars-*
) are checked for whether they are still in use.If there’s no Gradle version that still uses them, they are deleted. -
Files in shared caches used by the current Gradle version in
caches/
(e.g.jars-3
ormodules-2
) are checked for when they were last accessed.Depending on whether the file can be recreated locally or would have to be downloaded from a remote repository again, it will be deleted after 7 or 30 days of not being accessed, respectively. -
Gradle distributions in
wrapper/dists/
are checked for whether they are still in use, i.e. whether there’s a corresponding version-specific cache directory.Unused distributions are deleted.