To put breakpoints in your code, double click in the left margin on the line you want execution to stop on. You may alternatively put your cursor in this line and then press Shift+Ctrl+B.

To control execution use the Step Into, Step Over and Step Return buttons. They have the shortcuts F5, F6 and F7 respectively.

To allow execution to continue normally or until it hits the next breakpoint, hit the Resume button or F8.

Answer from James on Stack Overflow
🌐
Eclipse
help.eclipse.org › latest › topic › org.eclipse.jdt.doc.user › tasks › task-add_line_breakpoints.htm
Adding Line Breakpoints
Directly to the left of the line where you want to add the breakpoint, open the marker bar (vertical ruler) pop-up menu and select Toggle Breakpoint. You can also double-click on the marker bar next to the source code line. A new breakpoint marker appears on the marker bar, directly to the ...
🌐
Eclipse Foundation
eclipse.org › pdt › help › html › setting_breakpoints.htm
Setting Breakpoints
November 19, 2020 - Before you debug your scripts, you can set breakpoints in them to specify places in your code where the debugging process will pause.
🌐
Eclipse
help.eclipse.org › latest › topic › org.eclipse.jdt.doc.user › tasks › task-set_method_breakpoints.htm
Setting Method Breakpoints
Method breakpoints are used when working with types that have no source code (binary types). Open the class in the Outline View, and select the method where you want to add a method breakpoint.
🌐
University of Washington
courses.cs.washington.edu › courses › cse143 › 11wi › eclipse-tutorial › debugging.shtml
Eclipse tutorials
To create a breakpoint in a Java file inside Eclipse, all you need to do is double-click in the grey space immediately next to a line number on any line. It really makes no sense to put breakpoints on certain lines, like variable or method declarations.
🌐
University of Texas at Austin
users.ece.utexas.edu › ~miryung › teaching › EE461L-Spring2012 › labs › debugging.html
Debugging
Exception Breakpoint: This type of breakpoint is used to halt execution when a specified exception type is thrown at any time during execution. To set an exception breakpoint in Eclipse, use the "Run -> Add Java Exception Breakpoint..." menu item.
🌐
YouTube
youtube.com › pragmatic ways
How to set breakpoints to debug code in Java using Eclipse Debug mode - YouTube
Learn how to debug Java code using the built-in Debugging tool in Eclipse IDE. Learn more programming tips at https://www.PragmaticWays.com
Published   February 25, 2021
Views   10K
🌐
Javapro
javapro.io › home page › breakpoints – the lifeline of debugging – an eclipse features guide
Breakpoints – The Lifeline of Debugging – An Eclipse Features Guide - JAVAPRO International
February 25, 2026 - ... To put a method entry/exit breakpoint, just go to the outline view and say “toggle Method Breakpoint’ · This puts a breakpoint in the entry of method. We can also go to the line number of the method declaration and add a breakpoint.
Find elsewhere
🌐
Eclipse
help.eclipse.org › latest › topic › org.eclipse.jdt.doc.user › reference › views › breakpoints › ref-breakpoints_view.htm
Breakpoints View
The breakpoints view displays details of the selected breakpoint and can be used to configure attributes of the selected breakpoint similar to the Breakpoint Properties... action. The orientation of the detail pane can be configured from the view drop down menu. The commands available in the Breakpoints View are listed below. ... Adding breakpoints Applying hit counts Catching Java exceptions Removing breakpoints Enabling and disabling breakpoints Managing conditional breakpoints Setting method breakpoints
🌐
O'Reilly
oreilly.com › library › view › eclipse-cookbook › 0596007108 › ch05s05.html
5.4. Setting a Breakpoint - Eclipse Cookbook [Book]
June 21, 2004 - To set a breakpoint in the JDT editor, double-click the marker bar next to the line of executable code to which you want to add a breakpoint (alternatively, highlight the line and select Run→ Add/Remove Breakpoint to toggle breakpoints).
Author   Steve Holzner
Published   2004
Pages   364
🌐
Coderanch
coderanch.com › t › 103685 › ide › Eclipse-breakpoint-class-jar-source
Eclipse breakpoint in class/jar with no source (IDEs and Version Control forum at Coderanch)
I did find after searching for ... simply do this: - Open the JAR file in the Package explorer (click the +) - Browse to the class file you want to breakpoint - In the outline view, click on the method you wish to breakpoint - Select 'Toggle Breakpoint' of course, this only ...
🌐
Eclipse
help.eclipse.org › latest › topic › org.eclipse.jdt.doc.user › reference › views › breakpoints › ref-addexception_viewaction.htm
Add Java Exception Breakpoint
Select the Add Exception Breakpoint command [ ] to add a Java exception breakpoint. ... In the Choose an Exception field, type a string that is contained in the name of the exception you want to add. You can use wildcards as needed ("* " for any string and "?
🌐
TechBloat
techbloat.com › home › how to add a breakpoint in eclipse
How to Add a Breakpoint in Eclipse - TechBloat
January 12, 2026 - Eclipse supports several types of breakpoints, including line breakpoints, method breakpoints, and conditional breakpoints, but the most common and straightforward to use is the line breakpoint. To add a line breakpoint, you need to locate the line of code where you want execution to pause.
🌐
Vogella
vogella.com › tutorials › EclipseDebugging › article.html
Java Debugging with Eclipse - Tutorial
February 26, 2026 - Eclipse provides a Debug perspective which gives you a pre-configured set of views. Eclipse allows you to control the execution flow via debug commands. To define a breakpoint in your source code, right-click in the left margin in the Java editor and select Toggle Breakpoint.
Top answer
1 of 7
67

You can easily set method breakpoints in 3rd party libraries without having the source. Just open the class (you'll get the "i-have-no-source" view). Open the outline, right-click on the method you want and click on Toggle Method Breakpoint to create the method breakpoint.

2 of 7
38

The most sure-fire way to do this (and end up with something that's actually useful) is to download the source (you say that it is open-source), and set up another "Java Project" pointing at that source.

To do that, get the source downloaded and unzipped somewhere on your system. Click "File"->"New"->"Java Project". In the next dialog, give it a project name and select "Create Project from Existing Source". Browse to the root location of the open source library.

Supposing that all the additional libraries that are required by the project and such are included in the project you downloaded, Eclipse will figure everything out and set the build path up for you.

You'll need to remove the open source jar from your project's build path, and add this new project to the build path of your project.

Now, you can just treat this as your code, and debug at will.

This gets around at least a couple of problems with other approaches:

  1. You could "attach source" to the jar file, but if the jar file was compiled without debug information, this still won't work. If the jar file was compiled with debug information (lines,source,vars...see http://java.sun.com/j2se/1.3/docs/tooldocs/win32/javac.html, and the -g option).

  2. You could add an "exception breakpoint" to see when the NullPointerException is raised, but that's a common exception, and may well get raised and dealt with many (hundreds of?) times prior to the one you're looking for. Plus, without the original source, you won't be able to really see much of anything about the code that is throwing the NullPointerException - the likelihood you'll be able to figure out what's wrong is pretty low.