java编程查找名字,在java(w).exe进程列表中查找.jar的名称

java编程查找名字,在java(w).exe进程列表中查找.jar的名称Inmycompanyenvironment,there’sthisscriptthatrunsonplentycomputersandthatIoccasionallyasktheuserstokillbecauseit’sknowntolockupfromtimetotime.Iwasthinkingofawaytoki…

java编程查找名字,在java(w).exe进程列表中查找.jar的名称

In my company environment, there’s this script that runs on plenty computers and that I occasionally ask the users to kill because it’s known to lock up from time to time.

I was thinking of a way to kill it myself. I’ve noticed I can remotely list using pslist and then killing it using pskill.

Now the problem is, when somebody’s running multiple java applications (ex. Eclipse, this application, another java.exe app,…) it becomes tricky to kill the correct application in the pslist, that would look something like this:

javaw 4214 .. …

javaw 5000 .. …

And so on. These are different applications, but they all run from javaw.exe. Is there a way of finding out the name of the .jar they are running, so I can kill the process based on that?

解决方案

You can list java processes with

jps

or

jps -v

Jps is a tool provided with JDK and JRE, you’ll find it in JDK_HOME/bin.

Option -v shows additional info (JVM start parameters)

今天的文章java编程查找名字,在java(w).exe进程列表中查找.jar的名称分享到此就结束了,感谢您的阅读,如果确实帮到您,您可以动动手指转发给其他人。

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/30517.html

(0)
编程小号编程小号

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注