Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can we stop a running java process through Windows cmd?

I am a newbie in cmd, so please allow me to ask a stupid question: How can we stop a running Java process through Windows cmd?

For example, if we start Jetty (a mini web server) with the following command:

start javaw -jar start.jar 

How do we find the process and stop it later?

Obviously the following command does not work:

stop javaw -jar start.jar 
like image 842
Winston Chen Avatar asked Apr 15 '10 08:04

Winston Chen


People also ask

How do I stop a java process in Windows?

If you want to kill all java.exe processes : taskkill /F /IM java.exe /T .

How do I stop a java process from running?

pgrep -a java will return the PID and full command line of each java process. Once you have the PID of the command you wish to kill, use kill with the -9 (SIGKILL) flag and the PID of the java process you wish to kill.

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 you kill a task in java?

Here's a quick one: 1) Open Notepad. 2) Paste the line taskkill /f /im java.exe to Notepad. 3) Save the file as "kill-java. cmd" .


1 Answers

When I ran taskkill to stop the javaw.exe process it would say it had terminated but remained running. The jqs process (java qucikstart) needs to be stopped also. Running this batch file took care of the issue.

taskkill /f /im jqs.exe taskkill /f /im javaw.exe taskkill /f /im java.exe 
like image 199
Tup Avatar answered Oct 06 '22 00:10

Tup