Follow this steps to add Custom Icon file in exe created in JavaFX applicaiton
- Create .ico and .png file of Custom Icon you want and place it in project Source folder (src).
- Considering You have already created artifact for the application.
(if not follow this link https://flaironix.com/2019/09/19/deploying-javafx-application-in-intelije-using-artifact/).
- You need to build your application by Build->Build Artifact ->Build
(Let It complete building )
- Go to .idea->artifacts->projectname.xml open the file
- Under tag enter last element option as following and value as path to icon
<option name="icons"> <JavaFxApplicationIcons> <option name="linuxIcon" value="$PROJECT_DIR$/src/Controller/logo.png" /> <option name="windowsIcon" value="$PROJECT_DIR$/src/Controller/logo.ico" /> </JavaFxApplicationIcons> </option>
- Now clean and rebuild the project your exe file will now have the icon you want in javafx application.
(if you still dont see Icon, clear cache of intelije and restart and manually delete file in out folder and then rebuild the project ).
- And Follow deployment using ANT so it will create EXE with icon file Custom Icon