java 如何停止 IntelliJ 中的所有进程?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36212930/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 01:05:24  来源:igfitidea点击:

How can I stop all processes in IntelliJ?

javaintellij-ideaide

提问by Ives

I am using intelliJ IDEA.

我正在使用 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.

Eclipse 没有这个问题。

PNG1

PNG1

PNG2

PNG2

回答by Matthew Read

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

IntelliJ 2017.2 现在在“停止进程”菜单(顶部栏上的按钮)中有一个“全部停止”按钮,在 OSX 上使用默认快捷键?+ F2

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.

  1. 单击顶部栏中的停止按钮。它将弹出一个菜单,列出所有进程。(调试窗口一侧的停止按钮是针对每个进程的,如您的屏幕截图所示。)

  2. 将鼠标悬停在第一个进程上,按住Shift,然后单击最后一个进程。

  3. Enter

Screenshot showing the result of steps 1 & 2:

屏幕截图显示了步骤 1 和 2 的结果:

screenshot

截屏

回答by CJ Jacobs

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

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

这是我不久前在 SO 上发现的一个不错的小解决方法,它会杀死名称中带有“java”的任何进程。

Just copy and paste into the terminal.

只需复制并粘贴到终端中即可。

回答by haugan

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.

不完全完美,但您可以按 Ctrl + F2(停止进程的快捷方式)并按 Enter。它比所有鼠标点击都要好,可以让您快速浏览正在运行的进程列表。