Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Knowing which java.exe process to kill on a windows machine [closed]

Tags:

java

windows

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!

like image 505
Peter Avatar asked Sep 15 '08 12:09

Peter


People also ask

How do I find out what Java process is running on Windows?

start "MyProgramName" java java-program.. Here start command will open a new window and run the java program with window's title set to MyProgramName. Your Java program will be killed only.

How do I kill a specific process in Windows Java?

Using taskkill, you can kill a process based on window title using a filter. If the window title has quotes in it, you can escape the nested quotes with a backslash ( \ ). You can use tasklist in a similar manner to search for a task based on its window title.

How do I stop a Java process in Windows?

Scroll down to the "Java.exe" process. Right-click the process name and select "End Task." Click "Yes" to confirm that you want to stop the process. The process stops, and any opened Java programs also stop.


2 Answers

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.

like image 130
Misha Avatar answered Oct 09 '22 09:10

Misha


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.

like image 41
Ricardo Reyes Avatar answered Oct 09 '22 07:10

Ricardo Reyes