Petr Mensik
Petr Mensik

Reputation: 27496

Stop code execution while debugging in Eclipse without terminating the thread

Is there a way how to stop debugging when program hits the breakpoint (i.e. I don't want to execute the code after it) without stopping entire application server (I am programming apps in Java, server is JBoss)?

I know only one way how to stop debug - red button with title Terminate which shuts down the server. So is there anything else?

Upvotes: 9

Views: 7928

Answers (4)

brrsble
brrsble

Reputation: 1

You can use Ctrl+Shift+I and execute throw new Exception(), it will stop the execution of the code without stopping the server.

Upvotes: 0

neun24
neun24

Reputation: 233

While debugging, context menu offers you to force a return. This instantly leaves the method and will take you back to the caller. One can also use Alt+Shift+F.

Upvotes: 8

ewan.chalmers
ewan.chalmers

Reputation: 16235

If you mean "I do not want the code after my breakpoint to execute", then you could use a conditional breakpoint to execute a return from that method.

(Note that you can execute any code you like in a conditional breakpoint. It does not have to be just a condition.)

Upvotes: 2

Houcem Berrayana
Houcem Berrayana

Reputation: 3080

You can hit the disconnect button. See the attached image. This will continue execution and stopping debugging without stopping the server. enter image description here

Upvotes: -1

Related Questions