Search code examples
javabuildgradle

Specify the GRADLE_USER_HOME in Windows 7


How do I configure the GRADLE_USER_HOME option? My Windows username contains a space(C:\Users\Baz Foo) and I think that the build fails because of this.

E:\workspace-sts-3.0.0.RELEASE\agweb\ag-client\ag-shared\build\classes\main
error: Class com.acme.client.conn.rmi.SessionRMIImpl not found.
error: Class Foo\.gradle\caches\artifacts-13\filestore\xerces\xercesImpl\2.1
0.0\jar\9161654d2afe7f9063455f02ccca8e4ec2787222\xercesImpl-2.10.0.jar not found
.
error: Class Foo\.gradle\caches\artifacts-13\filestore\xml-apis\xml-apis\1.4
.01\jar\3789d9fada2d3d458c4ba2de349d48780f381ee3\xml-apis-1.4.01.jar;C:\Users\Baz
not found.
error: Class Foo\.gradle\caches\artifacts-13\filestore\provided\jbpm\3.0.4\j
ar\f2a9f8f32e59b335e069b5444f6c36a30abf0845\jbpm-3.0.4.jar;C:\Users\Baz not fou
nd.
error: Class Foo\.gradle\caches\artifacts-13\filestore\log4j\log4j\1.2.16\bu
ndle\7999a63bfccbc7c247a9aea10d83d4272bd492c6\log4j-1.2.16.jar;C:\Users\Baz not
found.
5 errors ...

I have added an environment variable GRADLE_USER_HOME and set it to C:\Users\Baz Foo\.gradle and tried also with --gradle-user-home="C:\Users\Baz Foo\.gradle" but none of them work.


Solution

  • I have explicitly defined GRADLE_USER_HOME to point to a path without spaces(for example: E:\gradle-repository). The gradle-repository folder contains the initialization script(init.gradle file, see Gradle initialization scripts).