Search code examples
eclipsejavafxdeb

How to set a launcher icon to a .deb deployment, JavaFX


I want to ask, how can I set a launcher icon to a .deb deployment with eclipse.

I tried to figure it out with this post: How to set a launcher icon for the self-contained JavaFX2 application?

  1. I don't know the size of the icon (for Ubuntu)
  2. I don't know how I should declare the icon within the code
  3. It is correct to put the .png into the /build/package/linux folder?

Thanks in advance!


Solution

  • Found the solution by myself:

    1. The size which worked for me: 512x512 pixels

    2. First of all you need to create the build folder by the build.fxbuild file. After you get the folder, you have to create the folder "package" into the build folder. Then you create the folder "linux" into the folder "package". After that you have to put your desired picture into that folder with the same name you are going to deploy you application.
      ./build/package/YourApp.png

    3. At least you need to declare this icon into your build.xml (.build/build.xml).

      <fx:deploy ... 
          >
          <fx:info>
              <fx:icon href="YourApp.png"/>
          </fx:info>
      
          <fx:platform basedir="${java.home}"/>
          ...
      </fx:deploy>
      

    If you want to know, what resources are taken you can add verbose="true" into the deploy tag: <fx:deploy verbose="true" ...>
    Written in part 6.3.3.1: http://docs.oracle.com/javafx/2/deployment/self-contained-packaging.htm