Sometimes, I'll run a program that accidentally contains an infinite loop or something. Eclipse will let me continue editing the program, but be super slow. How can I stop it? (Do I want to restart the JVM?) Restarting eclipse itself always works, but that breaks my workflow.
I have a .bat file on my quick task bar (windows) with:
taskkill /F /IM java.exe
It's very quick, but it may not be good in many situations!
For newer versions of Eclipse:
open the Debug perspective (Window > Open Perspective > Debug)
select process in Devices list (bottom right)
Hit Stop button (top right of Devices pane)
For Eclipse: menu bar-> window -> show view then find "debug" option if not in list then select other ...
new window will open and then search using keyword "debug" -> select debug from list
it will added near console tab. use debug tab to terminate and remove previous executions. ( right clicking on executing process will show you many option including terminate)
The easiest way to do this is to click on the Terminate button(red square) in the console:
Source: Stackoverflow.com