Search code examples
javajenkinsjarexecutable-jarmacos-big-sur

Not able to access jarfile on desktop in Macos 11


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?


Solution

  • 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.