I'd like my application to write out some data (e.g. configuration, cache, licences etc) to a shared, all-user accessible location.
On Windows I've done this to %PROGRAMDATA%
.
On MacOS, my research has suggested using the Library/Application Support
directory.
While the user-specific ~/Library/Application Support
works, the non-user specific /Library/Application Support
doesn't seem to be write-accessible?
Example:
Files.writeString(Paths.get("/Library/Application Support/myfile.txt"), "hello world")
Throws Exception:
java.nio.file.AccessDeniedException: /Library/Application Support/myfile.txt
Is there a better destination for this kind of data?