Reputation: 2558
I'm deploying a self-contained application with JPackage. This is how I compile it for Windows:
call "%JAVA_HOME%\bin\jpackage" ^
--type %INSTALLER_TYPE% ^
--dest target/installer ^
--input target/installer/input/libs ^
--name Deshopp ^
--main-class com.app.AppLauncher ^
--main-jar %MAIN_JAR% ^
--java-options -Xmx2048m ^
--runtime-image target/java-runtime ^
--app-version %APP_VERSION% ^
--icon src/main/logo/windows/logo.ico ^
--vendor "ACME Inc." ^
--copyright "Copyright © 2019-20 ACME Inc." ^
--win-dir-chooser ^
--win-shortcut ^
--win-per-user-install ^
--win-menu
But how do I use a custom icon for the application header/window, instead of Windows' default one depicted below?
Upvotes: 3
Views: 1100
Reputation: 10640
In addition to the platform specific icon which you specify in the jpackage call, you also have to specify icons in the start method of your main class like this
primaryStage.getIcons().addAll(icon16, icon32, icon64, icon128);
where icon16, ... are icons for your application with the corresponding sizes.
Upvotes: 4