Oh well - process management under windows is a kind of pain. I especially had to deal with my maven/quarkus/intelliJ combination:
I can easily start qQarkus and attach a debugger, but intellij always fails to stop the related processes and ends up stuck. For a while, I used the task manager to manually kill the processes.
Sometimes I didn’t kill all properly and the port was blocked etc, you probably know the drill.
wmic to the rescue! With it, you can basiscally use SQL-ish syntax to do funny things like killing processes:
wmic process where "commandline like '%%projectname%%jar%%'" delete
Just put this inside of a batch file and tell intellij to call it. Et voila!