1. Step: We need to find the proper running process in the background, for that we will use the command...
ps aux
... which lists all running processes which mostly is too long of a list:
jurgen 39191 0.0 0.8 904472 69368 ?? S 2:19PM 0:11.78 /Applications/Google Chrome
jurgen 39043 0.0 0.2 2524472 13976 ?? Ss 9:51AM 0:02.62 com.apple.security.pboxd
jurgen 38473 0.0 0.0 2467260 432 ?? Ss Tue03PM 0:00.20 com.apple.XType.FontHelper
...
So we filter out only the process that we are looking for, by using the command 'grep' and using the console pipe '|' to concatenate the commands
ps aux | grep java
Result:
jurgen 39543 0.1 1.9 4845420 163316 s008 S+ 5:49PM 0:07.18 /Library/Java/JavaVirtu... exec:java
jurgen 39573 0.0 0.0 2432768 460 s007 S+ 6:08PM 0:00.00 grep java
Now this returns us the proper process but also the 'grep' process itself which we were just running in our pipe, to filter this, we concatenate yet another 'grep -v grep':
ps aux | grep java | grep -v grep
... and we only get the process we need
jurgen 39543 0.1 1.9 4845420 163316 s008 S+ 5:49PM 0:07.18 /Library/Java/JavaVirtu... exec:java
Now that we have identified our process with its process number 39543 (second column in our process), we can terminate it with the 'kill -9'* command, as follows:
kill -9 39543
* If your wondering: The -9 parameter tells the kill-Command to send a SIGKILL signal to our process
In conclusion the following - more generic code - needs to be executed:
ps aux | grep [server_process_name] | grep -v grep
kill -9 [identified_process_id]