Home > OS >  kill a java process in Linux
kill a java process in Linux

Time:11-20

I have a BI application (looker) runs on a linux VM. tobe able to restart the service, I need to clear the existing java process. In below screenshot, after run below script, there is a java process, but not showing in the list when I run jps script. What's the reason? and how can I properly terminate this java process?

ps aux | grep java

screenshot from SSH

CodePudding user response:

Have you tried these ?

killall java 

or

kill $(pidof java)

CodePudding user response:

As you can see from your image, the process id is changing each time 9287 / 9304 and represents | grep java - and not a java VM!

A common fix is to filter the ps results for not matching | grep -v, such as:

ps aux | grep java | grep -v --regexp=grep.\*java
  • Related