1

I want to connect mac machine to jenkins as a node. For that I'm using agent.jar file. While running

java -jar agent.jar

I'm getting following error -

Error : Unable to access jarfile agent.jar

If I move this jarfile to another directory like home directory it works but not on desktop. Permission is not the problem here as I have provided executable permission to this file. It doesn't work in sudo too on desktop folder.

What could be the issue?

Nishi
  • 57
  • 12
  • MacOS has a security measurement active that disallows programs access to certain user folders. You have to grant `/usr/bin/java` full disc access in security settings. Also make sure to run the command in a UI terminal because sometimes a popup windows asks if you want to grant access. – Robert Jan 05 '22 at 12:14
  • Did provide full disk access to /usr/bin/java still facing same issue and don't know what is UI terminal :( – Nishi Jan 05 '22 at 12:54
  • UI terminal is the regular terminal program you start. I mentioned that just in case you are working via SSH on the MacOS system (SSH console = non-UI access). – Robert Jan 05 '22 at 13:09
  • Got it. I have full access to Mac System so that should not be a problem. It didn't ask for any permission or anything while trying to run that command. – Nishi Jan 05 '22 at 13:15

1 Answers1

3

I was able to resolve this after dragging /Library/Java/JavaVirtualMachines/jdk-13.0.2.jdk/Contents/Home/bin/java to Full disk access under Security and privacy.

Nishi
  • 57
  • 12