Debugging based on Exception in Breakpoints Eclipse

we know how to debug in eclipse using breakpoints, Now we are going to learn how to debug based on exceptions in eclipse,

Window -> Show view -> Breakpoints

It will look like this,


click “Add Java Exception Breakpoint” icon as mentioned in the above screenshot,

Sample Java Program:

package in.javadomain;

public class BreakPointException {

	public static void main(String[] args) {
		int a = 10;
		int b = 0;
		int c = a / b;
		System.out.println("Ans:::" + c);


And configure the ArithmeticException in the breakpoint,
arithmetic exception

And Now Rightclick on the above java file
Debug As -> Java Application

When arithmetic exception occured, it will be automatically stop in that point like below,
exception occured

Recommended Books:

555 total views, 2 views today

About: Mirthbees

Blogger, Innovator, Developer and Enterpreneur. Founder of GuruRecharge, Readymade online recharge script. Lead Developer in