Not responsive Java process

A Java application has crashed and needs to be restarted. In order to be able to execute the application again, the not responsive process first needs to be stopped. The application is installed on a remote server, so the operations need to be performed via remote shell.
1 answer

Stop Java process


1. After login to the server where the process was running, we look for the Java process to be stopped (since the application is in Java, this should be visible in the process list). The "ps aux" command searches through all running processes and the "grep" command filters based on a key word:

ps aux |grep java

2. In order to be sure that our process is still active, we can look also for the specific name of the application:

ps aux |grep java|grep [application_name]

3.a. In case there are no other Java processes on the server (as it can be verified from the results of the first command), the easiest would be to kill all the Java processes:

killall -9 java

3.b. In case there are several Java processes running on the server, then from the results of the first command we can identify the process ID of our Java application. This process ID can then used for stopping the process:

kill -9 [process_ID]