Search code examples
spring-bootprocesspid

Stopping specific Spring Boot applications among many


I have a few Spring Boot Application jars which have been started up by running:

java -jar Application1.jar
java -jar Application2.jar
java -jar Application3.jar

I want to stop a specific Spring Boot app (for example Application1) but when I list all running processes, I will have a list like:

Image Name                     PID Session Name        Session#    Mem Usage
========================= ======== ================ =========== ============
java.exe                     17932 Console                    1     70,928 K
java.exe                     15666 Console                  ...      .......

How do I stop the specific Spring Boot process?

Or is there a way to start up a Spring Boot application and give it a customised process's name so I can stop it in the future?


Solution

    1. You need to check which processes are running on which port, use the following command

      netstat -ao |find /i "listening"

    You get the following result

    2.As you mentioned you have the port number for the specific application you need to stop. for example, you need to stop application running on port 8080. Notice the process id for that particular port number(last column for port:8080 process id:14024)

    3.Stop process running at your port number Taskkill /F /IM 14024 you will get the following result. enter image description here

    Hope this helps!