简体   繁体   中英

PackageMaker on Mac OS X with Java Applcation

Step 1: I have a Java application that I bundle into a .app file via Jar Bundler. The Java file relies on some folders, one of which is called "Config"

Step 2: I right click MyApplication.app, select "Show Package Contents", and plot the Config folder into the "Resources" folder.

Step 3: Then, I use PackageMaker to make the application install file. That goes great.

But, when I install the application on my own computer to test it, and run the application, a Java error is made when I try to write to the Config folder. Namely, it is an IOException: Permission Denied. This does not happen when I run the application that is produced in Step 2. How can I fix this? Something about the PackageMaker Step 3 is resulting in the Java code being unable to write to the Config file.

Mac OS X applications should not write to their own bundles, and the packaged application that you're creating has permissions that (correctly) disallow this.

Files that your application writes to should be stored in the user's Library folder somewhere, probably under the Application Support or Preferences directory, depending on what they are.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM