This message was deleted.
# community-support
s
This message was deleted.
c
worth checking how IntelliJ is configured to run Gradle (which JVM is it using), and whether this is an M1 or Intel Mac (the screenshot indicates Intel, is it possible this was migrated to M1 at some point).
d
I am finding it impossible to get gradle to work
c
Gradle version? JVM version?
does it work from the command line?
d
Gradle 7.1 and Java 11
c
there are some reports that this error is due to invalid permissions for ~/.gradle; perhaps try
chmod 777 ~/.gradle
d
Yes I had tried, but it doesn't create the .gradle folder in the .-directory. Why does this happen?
c
what is `GRADLE_HOME`and `GRADLE_USER_HOME`set to?
d
I don't have those environment variables, I just looked for them with the command
printenv
c
Does the error happen when running `./gradlew`from the command line?
d
no such file or directory: ./gradlew
c
In your project directory? If your project is using gradle it will have a gradle directory and `gradle.bat`and `gradlew`scripts.
d
what should be set to
GRADLE_HOME
and
GRADLE_USER_HOME
?
c
nothing. defaults are acceptable.
`gradlew`is there. Run `./gradlew`in that directory (perhaps it needs
chmod +x gradlew
)
d
yes, then?
c
what is the output? Is it the same error?
d
no error
c
that the chmod.
./gradlew
executes gradle.
d
here
c
yep. permission problem. does this run successfully?
mkdir ~/.gradle
d
yes, does not work with sudo?
c
type in that command, try again pls.
*typo
d
I added
sudo
and then the passwrod and there was no error...
now I see the .gradle
c
ok. you should not have to sudo to create a directory in your home directory. what are the permissions on your home directory?
ls -ld ~
yea, its there now, but Gradle won’t be able to create folders underneath it as it was created by root.
that’s good; check
ls -ld ~/.gradle
although there is something janky about the user/group setup - those big numbers should be username/group, looking like:
Copy code
drwxr-xr-x+ 61 chrislee  staff  1952 11 May 12:16 /Users/chrislee
typo again…
d
may be a problem with the user and permissions?
c
check the permissions on the new ~/.gradle folder, if they are good (owned by your user and drwx permissions) try running ./gradlew again
what is the output from
Copy code
find ~/.gradle -depth 1
d
nothing happened with this command
try the permissions one again
these are the permissions of another person
c
yea, ~/.gradle is owned by root. check your current username with `echo $USER`and use that in the following command
Replace USER with your username
sudo chown "USER" ~/.gradle
d
ready
c
excellent; try running ./gradlew again
d
no such file or directory
c
run that in the project folder, as before.
d
omg
can I see some light?
c
that’s gradle running!
d
I think I'm going to cry, really
c
good stuff. the root cause is something to do with your MacOS user account / home directory permissions.
should be good to go now that we manually got the ~./gradle directory created.
d
can I run a command to see the version ?
c
./gradlew --version
d
I don't know how to thank you, thank you so much, thank you so much! If it wasn't for you, I would lose a few days on this !
👍 2
❤️
v
But you should really fix up your home directory permissions. Many programs will want to write in there and fail due to strange permissions.
d
If this is true, I will see the administrators to fix it ! Thank you very much