Sunday, April 3, 2022

How to kill java process in windows and unix

Sometimes, there are multiple java threads executed and might get hang, in order to kill them all together, below are the provided steps:

Windows:

a. Open command prompt as admin: click on Windows button and type "cmd", right click and select run as administrator


b. Once the command prompt is open type below command and hit enter

taskkill /im java.exe


It will terminate all the java.exe programs running in the Winows.

Unix:

Below are 2 ways to kill the java process:

a. To kill all java processes

pkill -f 'java -jar'

b. To find all the java processes

ps -ef | grep java

Once found the list of java process it can be killed by kill command by providing process id

kill -9 process_id 

Process_id is from the previous command



No comments:

Post a Comment

Set up gmail in outlook using app password

You might receive an error saying, "unable to connect to your outgoing server" while setting up a gmail account in outlook even wh...