Knowing which java.exe process to kill on a window

2020-01-27 00:18发布

When a java based application starts to misbehave on a windows machine, you want to be able to kill the process in the task manager if you can't quit the application normally. Most of the time, there's more than one java based application running on my machine. Is there a better way than just randomly killing java.exe processes in hope that you'll hit the correct application eventually?

EDIT: Thank you to all the people who pointed me to Sysinternal's Process Explorer - Exactly what I'm looking for!

标签: java windows
12条回答
一夜七次
2楼-- · 2020-01-27 00:56

Run jps -lv which shows PIDs and command lines of all running Java processes.

Determine PID of the task you want to kill. Then use command:

taskkill /PID <pid>

to kill the misbehaving process.

查看更多
不美不萌又怎样
3楼-- · 2020-01-27 00:58

Download Sysinternal's Process Explorer. It's a task manager much more powerfull than Windows's own manager.

One of it's features is that you can see all the resources that each process is using (like registry keys, hard disk directories, named pipes, etc). So, browsing the resources that each java.exe process holds might help you determine wich one you want to kill. I usually find out by looking for the one that's using a certain log file directory.

查看更多
Rolldiameter
4楼-- · 2020-01-27 00:58

If the application is not responding at all, then Process Explorer is a good option.

If it's sort of responding, but not dying, sometimes bringing up task manager, and then moving another dialog over the java process will give you a clue. The java process that's taking up cpu cycles to redraw is the one you're looking for.

查看更多
Viruses.
5楼-- · 2020-01-27 01:01

You could try opening Windows Task Manager, going to the Applications tab, right clicking the application and then selecting "Go To Process". This will automatically highlight the appropriate process in the Processes tab.

查看更多
唯我独甜
6楼-- · 2020-01-27 01:06

Using ProcessExplorer and hovering over the Java process will show the command line.

查看更多
家丑人穷心不美
7楼-- · 2020-01-27 01:09

Using jps in the JDK will give you more information. More information is display with the -m, -l and -v options.

查看更多
登录 后发表回答