如何停止从 Eclipse 执行的 Java 应用程序
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12693106/
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
How to stop Java application executed from Eclipse
提问by Alex F
Let's say I have Java console application with endless loop in main function. When I execute it from the DOS window:
假设我在主函数中有无限循环的 Java 控制台应用程序。当我从 DOS 窗口执行它时:
java MyBuggyProgram
I can press Ctrl+C to stop it. How can I stop it, when I use Run command from Eclipse (Windows)? The program is not listed in the Task Manager. Ctrl+C in the Console window doesn't work.
我可以按 Ctrl+C 停止它。当我从 Eclipse (Windows) 使用运行命令时,如何停止它?该程序未在任务管理器中列出。控制台窗口中的 Ctrl+C 不起作用。
回答by kosa
On bottom right of eclipse you will see one red icon. You can click on it. It pops up confirmation message. Just accept it.
在 eclipse 的右下角,您将看到一个红色图标。你可以点击它。它弹出确认消息。只要接受它。
回答by Johannes
Click on the terminate icon (red square) in the console view.
单击控制台视图中的终止图标(红色方块)。
回答by ?l?
The process hasto be in the list in the Task Manager. Check for processes using large share of CPU. Most likely name isjavaw.exe
该工艺具有可在任务管理器的列表。检查使用大量 CPU 的进程。最有可能的名称是javaw.exe
回答by alvarodoune
go to:
去:
Windows -> Show View -> Other... -> Android -> Devices
Windows -> 显示视图 -> 其他... -> Android -> 设备
and press the STOP red button
然后按下 STOP 红色按钮
回答by Chetan Gowda
回答by Devesh kumar
run below command in CMD
在 CMD 中运行以下命令
netstat -ano |findstr <-port no->
you will get pid (process id) for the running application
您将获得正在运行的应用程序的 pid(进程 ID)
taskkill /f /pid <-your pid->