Debugging based on Exception in Breakpoints Eclipse

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:

819 total views, 3 views today

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.