Published at DZone with permission of Jay Fields, author and DZone MVB. (source)
I often use IntelliJ to run applications
and on occasion things go wrong. For example, a thread that wont
terminate can cause a running application to become unstoppable via the
IntelliJ UI. Usually when this happens I end up running ps aux | grep java and following up with a kill -9
for each process that looks like it might be the one I'm looking for.
On good days there's only a few processes; however, things are more
complicated when I have several to look through.
Last week I noticed that the command used to launch the process printed
in the Console window, and, more importantly, the idea.launcher.port is
part of that command: e.g. idea.launcher.port=7538. Assuming the port is
unique, or even almost unique it's much easier to ps aux | grep for than java.
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)