Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse: stop code from running (java)

Tags:

java

eclipse

jvm

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.

like image 347
Nick Heiner Avatar asked Oct 04 '09 00:10

Nick Heiner


People also ask

How do you end an endless loop in Java?

Just type break; after the statement after which you want to break the loop.

Why my Eclipse is showing previous output?

My suspicion is you have settings which are causing it to launch the last launched item, rather than something new that does not have a launch configuration. If you hover over the Run icon, it will show the name of the launch configuration that Eclipse will launch.


1 Answers

Open the Console view, locate the console for your running app and hit the Big Red Button.

Alternatively if you open the Debug perspective you will see all running apps in (by default) the top left. You can select the one that's causing you grief and once again hit the Big Red Button.enter image description here

like image 128
SCdF Avatar answered Sep 21 '22 13:09

SCdF