简体   繁体   English

具有Java应用程序的Mac OS X上的PackageMaker

[英]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. 步骤1:我有一个Java应用程序,可以通过Jar Bundler捆绑到.app文件中。 The Java file relies on some folders, one of which is called "Config" Java文件依赖于某些文件夹,其中之一称为“ Config”

Step 2: I right click MyApplication.app, select "Show Package Contents", and plot the Config folder into the "Resources" folder. 步骤2:我右键单击MyApplication.app,选择“显示包内容”,然后将Config文件夹绘制到“ Resources”文件夹中。

Step 3: Then, I use PackageMaker to make the application install file. 步骤3:然后,我使用PackageMaker制作应用程序安装文件。 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. 但是,当我在自己的计算机上安装该应用程序以对其进行测试并运行该应用程序时,尝试写入Config文件夹时会出现Java错误。 Namely, it is an IOException: Permission Denied. 即,它是一个IOException:权限被拒绝。 This does not happen when I run the application that is produced in Step 2. How can I fix this? 运行步骤2中生成的应用程序时不会发生这种情况。如何解决此问题? Something about the PackageMaker Step 3 is resulting in the Java code being unable to write to the Config file. 关于PackageMaker步骤3的某些情况导致Java代码无法写入Config文件。

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. Mac OS X应用程序不应写入自己的捆绑软件,并且您正在创建的打包应用程序具有(正确)不允许这样做的权限。

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. 应用程序写入的文件应存储在用户的“库”文件夹中的某个位置,可能在“应用程序支持”或“首选项”目录下,具体取决于它们是什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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