0

I built a .pkg from a .jar file with javapackager tool. It works well and the JRE is installed as well as my .jar and the program start like it should. The program is installed in Application folder (on a mac of course) and run well. But it doesn't have the write permission to create a file (in the Application folder).

If I run a chmod -R 777 on my application folder everything is ok.

So how can i give the right to write in the installation folder to the .jar ? Using javapackager (because i don't want my user to have to run a command).

Thanks a lot

1 Answers1

1

You can't, the Application folder is a system wide folder, it's normal that your app can't write inside this folder, simply because your user can't write to this folder (only with elevated priviledges)

You have two solutions, i guess.

The first one: Write to another location. The MacOS documentation suggests to write inside System.getProperty("user.home") + "/Library/" + "Your App Name"

The second one: Don't install your app inside the system Application folder. You can do that simply by passing the following javapackager bundler option : -DsystemWide=false

Prim
  • 2,880
  • 2
  • 15
  • 29