You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Unable to access jarfile

Apparently everything was working fine before I restarted my macOS. After restarting I am facing following problems on desktop folder while using terminal


  1. It didn't allow me to run basic linux command like "ls" in desktop directory. I gave permission to terminal to access full disk then it worked fine.
  2. There is a jar file in desktop that I am not able to access/execute. The same jarfile I am able to execute in other directory. I have checked read and write access of current user for desktop directory and they are correct.


Not sure what is the issue here. how to resolve this issue? I want to run this in desktop folder only -

java -jar file.jar


Posted on Jan 5, 2022 4:33 AM

Reply
Question marked as Top-ranking reply

Posted on Jan 5, 2022 10:16 PM

I was able to resolve this issue, I was giving /usr/local/bin/java permission instead of "/Library/Java/JavaVirtualMachines/openjdk-13.0.2.jdk/Contents/Home/bin/java". After this I was able to run jarfile.

5 replies

Jan 5, 2022 4:54 AM in response to Nishi76

macOS doesn’t run Linux. It runs Unix. Linux did copy most of Unix.


The java program may not have access to your documents. Apps have to ask permission to access your data.


Another possibility is if you have Desktop & Documents in iCloud Drive, and that file hasn’t been downloaded, the java command may not trigger the download in order to run the actual file.

Unable to access jarfile

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.