Eclipse: how to set breakpoint on library JAR source?

D

davout

In my Eclipse Java project I have an exception occuring inside one of the
external JAR files that make up the project (apache commons-validator).

I've downloaded the commons-validator source and in the Eclipse IDE linked
the source path to the JAR file so that I can now see where the exception is
occuring inside this JAR.

However, I can't set breakpoints on this JAR source that actually work. The
IDE allows me to toggle the breakpoint entry on selected lines but the
breakpoint isn't used as when run the application skips past it.

Simply put, how can I temporarily include the source code of an external
library JAR into my project so that I can debug/trace problems using
breakpoints?
 
D

Diego Guidi

In my Eclipse Java project I have an exception occuring inside one of the
external JAR files that make up the project (apache commons-validator).

I've downloaded the commons-validator source and in the Eclipse IDE linked
the source path to the JAR file so that I can now see where the exception is
occuring inside this JAR.

However, I can't set breakpoints on this JAR source that actually work. The
IDE allows me to toggle the breakpoint entry on selected lines but the
breakpoint isn't used as when run the application skips past it.

Simply put, how can I temporarily include the source code of an external
library JAR into my project so that I can debug/trace problems using
breakpoints?

Your operations are correct, and the breakpoint must work.
Maybe the source does not match the jar version? In this case what you
view is not what happen in the code
 
O

Oliver Wong

davout said:
In my Eclipse Java project I have an exception occuring inside one of
the external JAR files that make up the project (apache
commons-validator).

I've downloaded the commons-validator source and in the Eclipse IDE
linked the source path to the JAR file so that I can now see where the
exception is occuring inside this JAR.

However, I can't set breakpoints on this JAR source that actually work.
The IDE allows me to toggle the breakpoint entry on selected lines but
the breakpoint isn't used as when run the application skips past it.

Simply put, how can I temporarily include the source code of an external
library JAR into my project so that I can debug/trace problems using
breakpoints?

In the way that you'd probably expect: Delete the jar, add the source
code files to your project, debug. When done, delete the source code
files, re-add the jar.

As Diego mentions, the problem is probably that your JAR and source
don't match up, but if the problem is with your code (e.g. passing in an
illegal parameter or something), hopefully the same exception will be
thrown despite the version difference.

- Oliver
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,742
Latest member
AshliMayer

Latest Threads

Top