Gradle's wrapper is creating a folder called "?"

When I run the command “./gradlew build”, gradle automatically creates a folder called “?” (question mark) and unzips the gradle wrapper there and also download all the project dependencies into the same folder rather than put it in ~/.m2 folder

I don’t have installed gradle neither maven nor groovy, I’m using the gradle wrapper only

Do you have any idea why is this happening?

Gradle doesn’t do that normally, so it sounds like some special to your configuration/build.

Gradle doesn’t use ~/.m2 for downloaded dependencies. It keeps a cache in GRADLE_USER_HOME (which is usually ~/.gradle).

Are you seeing wrapper/dists directory in the “?” directory? Could your GRADLE_USER_HOME be set to “?” ? Otherwise, it sounds like maybe your build is doing that as part of one of the build tasks.

Now I installed gradle via gvmtool and I running gradle build directly rather then run it by the wrapper, and same thing happend. If I remove the folder “?”, gradle is creating the folder again and put all the project dependencies there. I check the build.gradle file if there is some setting related to this, but found anything.

Now my GRADLE_USER_HOME is: ~/.gvm/gradle/current

The .gradle folder was created into the folder “?”

Here I put part of the gradles log

Unzipping /home/projects/webRest/?/.gradle/wrapper/dists/gradle-2.3-all/65cghn432lqt7oeaej42642hdj/gradle-2.3-all.zip to /home/projects/webRest/?/.gradle/wrapper/dists/gradle-2.3-all/65cghn432lqt7oeaej42642hdj
Set executable permissions for: /home/projects/webRest/?/.gradle/wrapper/dists/gradle-2.3-all/65cghn432lqt7oeaej42642hdj/gradle-2.3/bin/gradle

As you can see gradle is being unziped into folder “?”, that, at the same time exists into the application folder which is webRest

Is there any progress on this?

I am experiencing the same problem. This is on a Ubuntu 14.04 machine, but I use gradle installed from the current nixos packages.

$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.3 LTS"

$ gradle -version

------------------------------------------------------------
Gradle 2.8
------------------------------------------------------------

Build time:   2015-10-20 03:46:36 UTC
Build number: none
Revision:     b463d7980c40d44c4657dc80025275b84a29e31f

Groovy:       2.4.4
Ant:          Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM:          1.8.0_76 (Oracle Corporation 25.76-b00)
OS:           Linux 3.18.1-tf1-ll amd64

$ nix-env --version
nix-env (Nix) 1.10

I’ve had the same problem inside a docker container. Setting the GRADLE_USER_HOME variable should work, but you can have the same ./? directory problem with the location of the .m2 directory, for example.

I’ve solved the problem setting the user.home java system property. It seems that gradle, grails and maven (for example) use that property to build the path to their directories, so just try

export _JAVA_OPTIONS=-Duser.home=/home/user