how to change the name of a Java application process?

后端 未结 10 2323
借酒劲吻你
借酒劲吻你 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:25

    Assuming that what you are really after is a way to terminate the correct the correct process later on, then an alternative solution is this:

    Run ps -ef | grep java and you should get a listing that looks something like this:

     mruser    7518  7505  4 11:37 pts/3    00:00:00 /usr/bin/java -classpath MRD3030_Linked.jar peralex.MyApp
    

    Then pkill -f peralex.MyApp will kill the correct process.

提交回复
热议问题