As stated above, you need to allow Full Disk Access in your System Preferences in macOS. Here they mention that you need to search for 'JavaLauncher.app'. This is an issue due to macOS changes with security management.
To give Full Disk Access to JAR files on macOS:
- Go to System Preferences.
- Click on Security and Privacy.
- Search for 'Full Disk Access'.
- Click on the lock at the bottom left to be able to make changes.
- Click on the '+' icon at the bottom left of the FDA panel and a Finder prompt will appear.
- Go to System/Library/CoreServices/JavaLauncher.app
- Select the JavaLauncher.app and click 'Open'
That's it. You should be able to access files through your Java application. This helped to fix my issue with MARS MIPS not saving files properly on my laptop. I constantly needed to save it elsewhere.