9. Give the application an icon and a name - fakeivchenko/lwjwae GitHub Wiki

So far, the application is called notes, after the project, and has the icon that the system gives any program. Give it a name and an icon that people recognize.

  1. Draw the icon as one square PNG file, 256 pixels or larger, and save it as src/main/icons/app.png:

    notes/
    โ””โ”€โ”€ src/main/
        โ”œโ”€โ”€ icons/app.png
        โ”œโ”€โ”€ java/com/example/notes/Main.java
        โ””โ”€โ”€ resources/app/
    

    The plugin finds the icon there without any configuration, and renders every size that a platform needs from it: a .ico file in the executable on Windows, a .icns file in the bundle on macOS, and the sizes of the icon theme on Linux. Keep the corners transparent where the picture is round.

  2. In build.gradle.kts, name the application and who publishes it:

    group = "com.example"
    version = "1.0.0"
    description = "Notes that stay on your machine"
    
    lwjwae {
        displayName = "Notes"
        vendor = "Example <[email protected]>"
    }
    
    Setting Where it shows
    displayName The Linux menu, the Windows Start menu and the Details tab of the properties of the executable, and the macOS menu bar and Dock.
    vendor The company of the executable and the manufacturer of the installer on Windows, without the address, and the maintainer of the Debian package, with it.
    version The version of the executable and of every package.
    description The one line that package managers and menus show next to the name.

On Windows, the icon and the name are part of the executable from the next build on. The taskbar shows the icon while the application runs, and the Details tab of its properties shows the name and the version. On Linux, the icon shows once a package installs the menu entry that points to it, which is what Package the application does.

The icon of Notes in the taskbar of KDE Plasma and of Windows 11

The Details tab of the properties of notes.exe

For every name and every platform setting that the plugin fills in for you, see the Gradle plugin configuration.


Previous: Show notifications ยท Next: Build a native executable