Permission issue or what?

I am using mac machine as the build machine.
I am using agent.jar to connect with the Jenkins server.
I am building an android project in machine via Jenkins.

If I run “./gradlew build” locally in the terminal it builds the project.
If I do the same task from the Jenkins job this Gradle build task is just stuck in the console log.

If I run the job in another mac machine(different agent) then it works. I don’t know what is the issue with the current machine. Please help

My mistake my JAVA_HOME variable was pointing to wrong location.