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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 16:47:49  来源:igfitidea点击:

how to change the process name of a Java application

javawindowsprocesstaskmanager

提问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 of
java com.something.something.MyClass

customName com.something.something.MyClass
代替
java com.something.something.MyClass

回答by Nirmal- thInk beYond

make exe with jsmooth, that provide you option to create separate process

使用jsmooth制作 exe ,为您提供创建单独进程的选项