JavaFX本机包图标OS X. [英] JavaFX native bundle icon OS X
问题描述
我正在尝试使用IntelliJ IDEA 14为JavaFX应用程序创建本机OS X应用程序包。我已经设置了一个Artifact,其本机包选项设置为dmg。这确实创建了一个本机包,但我似乎无法找到更改应用程序图标的方法。我应该如何实现这个目标?
I'm trying to create a native OS X app bundle for a JavaFX app using IntelliJ IDEA 14. I have set up an "Artifact" with the native bundle option set to dmg. This does create a native bundle, but I cannot seem to find a way to change the application icon. How should I go about achieving this?
我已经尝试根据其他答案将其放在以下目录中:
src / main /deploy/packages/macosx/project_name.icns
src / project_package_path / deploy / packages / project_name.icns
I have tried placing it in the following directories based on other answers:
src/main/deploy/packages/macosx/project_name.icns
src/project_package_path/deploy/packages/project_name.icns
我似乎无法在IntelliJ的网站上找到有关更改图标的确切信息。
I cannot seem to find definitive information on IntelliJ's website on changing the icon either.
推荐答案
我正在应用程序商店中测试应用程序,并希望确保我也正确设置了图标。
I am testing an app in the app store and wanted to ensure that I got the icon set up correctly too.
如果您使用的是javafx ant任务库,您可以执行以下操作:
If you are using the javafx ant task library you can do the following:
将icns文件放入项目中package / macosx / project_name.icns中的根目录
Place your icns file in your project root directory in package/macosx/project_name.icns
修改你的ant buildfile以在项目路径中包含项目根目录。
Modify your ant buildfile to include the project root in the classpath.
示例:
为fx:deploy任务启用详细输出。
enable verbose output for the fx:deploy task.
打开一个终端并为您的项目运行ant。
Open a terminal and run ant for your project.
输出应包含:
为project_name构建DMG包
使用默认包资源[Bundle config file] (将package / macosx / Info.plist添加到要自定义的类路径)
使用自定义包资源[icon](从类路径上的package / macosx / project_name.icns加载)
output should contain: Building DMG package for project_name Using default package resource [Bundle config file] (add package/macosx/Info.plist to the class path to customize) Using custom package resource [icon] (loaded from package/macosx/project_name.icns on class path)
这篇关于JavaFX本机包图标OS X.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!