Skip to content

The icon is not displayed correctly #482

Description

@tanhuang2016

JavaPackager version

1.7.6

Operating system

Windows

OS version

windows11

Build tool

Maven

JDK version

jdk21

Short description

The icon of the running main process is still that of openjdk

Steps to reproduce

You can take a look at my open source project:
https://github.com/tanhuang2016/RedisFX
The path of pom:
https://github.com/tanhuang2016/RedisFX/blob/main/rdm-ui/pom.xml
Download path for the installation package:
https://github.com/tanhuang2016/RedisFX/releases/download/v2.3.11/rdm-ui-2.3.11-windows-x86_64.exe

Expected behavior

The icon of openjdk should not be displayed,It should display its own icon just like idea
Image

Actual behavior

The icon of openjdk is displayed

Logs and output

This is the main configuration of pom





<build>
                <plugins>
                    <plugin>
                        <groupId>io.github.fvarrui</groupId>
                        <artifactId>javapackager</artifactId>
                        <!--这个版本可以打出msi和msm-->
                        <version>1.7.6</version>
                        <executions>
                            <execution>
                                <id>bundling-for-windows-amd64</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>package</goal>
                                </goals>
                                <configuration>
                                    <mainClass>redisfx.tanh.rdm.ui.Main</mainClass>
                                    <bundleJre>true</bundleJre>
                                    <modules>${modules}</modules>
                                    <!--                                    <jdkPath>D:\soft\jdk\jdk-21_windows-x64_bin\jdk-21.0.7</jdkPath>-->
                                    <jdkPath>${env.JAVA_HOME}</jdkPath>
                                    <generateInstaller>true</generateInstaller>
                                    <administratorRequired>false</administratorRequired>
                                    <platform>windows</platform>
                                    <createZipball>true</createZipball>
                                    <!--                            <additionalResources>-->
                                    <!--                                <additionalResource>${name}.l4j.ini</additionalResource>-->
                                    <!--                            </additionalResources>-->
                                    <winConfig>
<!--                                                                                <headerType>console</headerType>-->
                                        <icoFile>src/main/resources/icon/fx_icon_256.ico</icoFile>
                                        <generateSetup>true</generateSetup>
                                        <setupLanguages>
                                            <english>compiler:Default.isl</english>
                                        </setupLanguages>
                                        <wrapJar>true</wrapJar>
                                        <generateMsi>true</generateMsi>
                                        <generateMsm>true</generateMsm>
                                        <disableDirPage>false</disableDirPage>
                                        <disableProgramGroupPage>false</disableProgramGroupPage>
                                        <disableFinishedPage>false</disableFinishedPage>
                                        <disableRunAfterInstall>false</disableRunAfterInstall>
                                        <disableWelcomePage>false</disableWelcomePage>
                                    </winConfig>
                                    <vmArgs>
                                        <arg>--module-path</arg>
                                        <arg>libs</arg>
                                        <arg>--add-modules</arg>
                                        <arg>javafx.controls,javafx.fxml,javafx.graphics,javafx.media,javafx.swing,javafx.web,javafx.base</arg>
                                    </vmArgs>
                                </configuration>
                            </execution>



                        </executions>
                    </plugin>


                </plugins>
            </build>

Checklist

  • I searched for existing related issues
  • I can provide a minimal reproducible example if needed

Activity

  1. fvarrui commented on Oct 4, 2026

    @fvarrui
    Collaborator

    Thanks for the detailed report. This comes from how Launch4j works, the default exeCreationTool: your EXE starts the bundled javaw.exe as a separate process, so the running process shown by Task Manager (and grouped in the taskbar) is the JDK's, with its icon.

    Two things you can try:

    • winConfig.exeCreationTool set to winrun4j or why: both load the JVM inside your own EXE, so the running process is your app.
    • For the taskbar and window icon of a JavaFX app, also set the stage icons (stage.getIcons().add(...)).

    Could you tell us whether winrun4j or why solves it for you?

  2. fvarrui commented on Oct 4, 2026

    @fvarrui
    Collaborator

    Quick update: 2.0.0-rc1 is now on Maven Central, so you can test the fix without the snapshots repository, just with the new coordinates:

    • Maven: io.github.javapackager:javapackager:2.0.0-rc1
    • Gradle: classpath 'io.github.javapackager:javapackager:2.0.0-rc1' and apply plugin: 'io.github.javapackager'

    Release notes and upgrade guide: https://github.com/javapackager/JavaPackager/releases/tag/v2.0.0-rc1. Feedback before the final 2.0.0 release would be very welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfeedbackWaiting for feedback

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions