how to change the name of a Java application process?

后端 未结 10 2302
借酒劲吻你
借酒劲吻你 2020-11-27 04:51

When executing a Java application the process name given to it is usually java.exe or javaw.exe. But how can I make it be called by the name of my

10条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-27 05:28

    This is specific to Windows.
    I was facing the same issue where I have to kill the specific java program using taskkill. When I run the java program, tasklist was showing the same program with Image name set as java.exe. But killing it using taskkill /F java.exe will stop all other java applications other than intended one which is not required.

    So I run the same java program using:

    start "MyProgramName" java java-program..

    Here start command will open a new window and run the java program with window's title set to MyProgramName.

    Now to kil this java-program use the following taskkill command:

    taskkill /fi "MyProgramName"

    Your Java program will be killed only. Rest will be unaffected.

提交回复
热议问题