How can I stop all processes in IntelliJ?

35,973

Solution 1

IntelliJ 2017.2 now has a "Stop All" button in the "Stop process" menu (the button on the top bar), with the default shortcut +F2 on Mac OS:

screenshot

For older versions:

  1. Click the Stop button from the top bar. It will pop open a menu listing all processes. (The stop button at the side of the debug window is per-process, as in your screenshot.)

  2. Hover over the first process, hold Shift, and then click on the last process.

  3. Press Enter.

Screenshot showing the result of steps 1 & 2:

screenshot

Solution 2

kill $(ps aux | grep 'java' | awk '{print $2}')

This is a nice little workaround I found on SO a while ago that will kill any process with "java" in the name.

Just copy and paste into the terminal.

Solution 3

Not exactly perfect, but what you could do is press Ctrl + F2 (shortcut for Stop Process) and hit Enter. It's better than all that mouse clicking and gets you through a list of running processes quite fast.

Share:
35,973
Ives
Author by

Ives

Updated on July 31, 2022

Comments

  • Ives
    Ives almost 2 years

    I am using intelliJ IDEA.

    When I run my programs and close the window, the process still remains. If I run a lot of programs, I need to click disconnect many times.

    Is there any way to stop all processes?

    Eclipse doesn't have this problem.

    PNG1

    PNG2

  • CJ Jacobs
    CJ Jacobs about 8 years
    I usually get the complain kill: kill (some number) failed: no such process but even when I get that, the processes still stop
  • Ives
    Ives about 8 years
    when i paste it,i get kill is command or external command, Not recognized as operable program or batch file.
  • kgui
    kgui about 7 years
    @Ives try inputting that command into Cygwin if you're using Windows.
  • Davem M
    Davem M over 6 years
    nice solution, but running kill $(ps aux | grep 'java' | awk '{print $2}') as an external tool in intellij results in permission errors.
  • Davem M
    Davem M over 6 years
    works as an 'external tool' if you put it is a bash file, and chmod a+x the bash file.
  • WestCoastProjects
    WestCoastProjects over 5 years
    Command F2 is "Stop" not "Stop All" - at least on 2018.2 on macOS. I have many many bg processes that should die but do not.
  • Matthew Read
    Matthew Read almost 4 years
    For background processes, the default shortcut is Shift+⌘+F2.
  • ThreeCheeseHigh
    ThreeCheeseHigh about 3 years
    This isn't working for "zombie" processes which were started by IntelliJ but not cancelled.
  • Matthew Read
    Matthew Read about 3 years
    @ThreeCheeseHigh That's unfortunate -- sounds like a bug you should report to JetBrains!
  • Matthew Read
    Matthew Read about 2 years
    Simpler: pkill java (or pkill '.*java.*' to match this "contains" behavior).