在java(w).exe进程列表中查找.jar的名称 [英] Find name of .jar in java(w).exe process list

查看:552
本文介绍了在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.

我在想一种自己杀死它的方法。我注意到我可以远程列出使用 pslist ,然后使用 pskill 杀死它。

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.

现在的问题是,当某人运行多个java应用程序(例如Eclipse,这个应用程序,另一个java.exe应用程序...)时,杀死pslist中的正确应用程序变得棘手看起来像这样:

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 .. ...

等等。这些是不同的应用程序,但它们都从javaw.exe运行。有没有办法找出他们正在运行的.jar的名字,所以我可以杀死基于这个过程?

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?

推荐答案

您可以使用

jps

jps -v

Jps是JDK和JRE提供的工具,您可以在JDK_HOME / bin中找到它。
选项-v显示其他信息(JVM启动参数)

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(w).exe进程列表中查找.jar的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆