windows 如何更改 Java 应用程序的进程名称
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5892479/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to change the process name of a Java application
提问by Khoyendra Pande
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 application in window. I can't use http://launch4j.sourceforge.net/because I want to run this jar on server.
在执行 Java 应用程序时,赋予它的进程名称通常是 java.exe 或 javaw.exe。但是我怎样才能让它在 window.app 中被我的应用程序的名称调用?我不能使用http://launch4j.sourceforge.net/因为我想在服务器上运行这个 jar。
采纳答案by Nirmit Shah
Copy your java.exe as customName.exe (and put it in the same location where your java.exe is) and run your program as
将您的 java.exe 复制为 customName.exe(并将其放在您的 java.exe 所在的相同位置)并以以下方式运行您的程序
customName com.something.something.MyClass
instead ofjava com.something.something.MyClass
customName com.something.something.MyClass
代替java com.something.something.MyClass