2

On MacOS Ventura (13.3.1) I am trying to run a jar file

java -jar somefile.jar

and get the error

Error: Unable to access jarfile somefile.jar

Having looked for how to solve this it seems I have to give "Full Disk access" to "Java". I found some answers with some links to some various locations, none of them do exist.

So how to solve this problem? What EXACT file do I have to give full disk access for MacOS Ventura and java version 1.8.0_371 (or how to figure that out)?

I tried these solutions and this suggestion:

  1. /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home -> JavaAppletPlugin.plugin is greyed out, unable to select it: enter image description here
  2. /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/ -> Path does not exist (no "Java" under "Library")
  3. /Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home -> Folder under "JavaVirtualMachines" is empty...

I installed java following the instructions given in HERE.

6
  • What path does running /usr/libexec/java_home give you?
    – grg
    Jun 15, 2023 at 9:02
  • /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
    – Alex
    Jun 15, 2023 at 9:05
  • You may reference stackoverflow.com/questions/70592466/…
    – exudong
    Jun 16, 2023 at 7:39
  • added the reference ...
    – Alex
    Jun 16, 2023 at 7:59
  • 1
    Hmm, java_home should return something like /Library/Java/JavaVirtualMachines/jdk-15.0.2.jdk/Contents/Home, the plugin is for browsers and may not even be installed any longer. How did you install Java?
    – nohillside
    Jun 16, 2023 at 9:43

1 Answer 1

2
+100

You must go to Security & Privacy in Settings --> Privacy --> Full Disk Access. Then give your jar file access there. For more info, go to https://stackoverflow.com/questions/65469536/why-does-a-jar-file-have-no-permissions-to-read-from-disk-when-started-via-doubl

2
  • Now I get an error Exception in thread "main" java.lang.UnsupportedClassVersionError: de/bluecolored/bluemap/cli/BlueMapCLI has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 I guess I have to update java? How to do that IN THE MOST SIMPLE WAY POSSIBLE???
    – Alex
    Jun 20, 2023 at 18:13
  • 1
    This article explains it quite simply: java.com/en/download/help/mac_java_update.html
    – DevBev3
    Jun 22, 2023 at 2:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .