Change icon .exe native packaging javafx

0

I have a problem with the icon of an .exe generated from a native javafx package. I see the Java icon instead of the application icon. How could I change it ???

    
asked by Maurikius 29.11.2016 в 20:44
source

2 answers

1

for this you can use the free tool Launch4J . It is very simple to use and effective, plus you can find lots of tutorials on the internet. I personally have used it in my JavaFX projects with very good results. Greetings

    
answered by 12.05.2017 в 15:55
0

First, you should indicate how you are generating that .exe. I understand that you are generating it with the javapackager utility that comes in the jdk, either directly or with a maven plugin for example. This utility receives a parameter -Bicon = {path of your icon}. In my project (using maven) I have something like this:

<executable>${jdk.home}bin/javapackager</executable>

<arguments>
   <argument>-deploy</argument>
   <argument>-native</argument>
   <argument>-outdir</argument>
   ...
   <argument>-vendor</argument>
   <argument>${app.vendor}</argument>
   <argument>-Bicon=${project.build.directory}/..${icon.bundle}</argument>
   <argument>-BappVersion=${app.version}</argument>
   ...
</arguments>

The variable $ {icon.bundle} being the one that affects you directly and that in my case is dependent on the OS on which I want to generate the executable (OSX and Windows):

    <profile>
        <id>windows</id>
        <properties>          
          <icon.bundle>\src\main\deploy\package\windows\Icono.ico</icon.bundle>
        </properties>
    </profile>
    <profile>
        <id>mac</id>
        <properties>
            <icon.bundle>/src/main/deploy/package/macosx/Icono.icns</icon.bundle>
        </properties>
    </profile>

I hope it helps you. If you can not check the official doc of javapackager.

    
answered by 04.12.2016 в 12:05