问题
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?
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
I cannot seem to find definitive information on IntelliJ's website on changing the icon either.
回答1:
I am testing an app in the app store and wanted to ensure that I got the icon set up correctly too.
If you are using the javafx ant task library you can do the following:
Place your icns file in your project root directory in package/macosx/project_name.icns
Modify your ant buildfile to include the project root in the classpath.
example:
enable verbose output for the fx:deploy task.
Open a terminal and run ant for your project.
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)
来源:https://stackoverflow.com/questions/29303633/javafx-native-bundle-icon-os-x