0

In my project I added an API to my project.

For some reason I have to change a method of one class of that API.

Now I want to know how this change affect on my project.

So I used F7 to go through the method .

But it doesn,t work, F7 acted like F8 here !!

What should I do for debugging the methods of a class?Using Junit Test is helpful here? Thanks.

Sara Bony
  • 31
  • 1
  • 8

2 Answers2

0

If you are using maven you can specify that library sources should be downloaded when you collect project dependencies. Then, when you debug through your code, you can step "down" into your API classes as the project has the source available as a reference. Although I've never used netbeans and so don't know to what extent it works with maven.

See, for example

Get source jar files attached to Eclipse for Maven-managed dependencies

and

Get source JARs from Maven repository

Community
  • 1
  • 1
davek
  • 22,499
  • 9
  • 75
  • 95
  • Thanks but I am not using maven.I install the library on my computer by right click the project name and add jar folder.You mean it is not possible to go through methods of library by using f7? – Sara Bony Jul 12 '12 at 04:53
  • You need the source files to do that (if they are available online), not just the .jar file. – davek Jul 12 '12 at 07:37
  • I also have the source files, now what should i do? How can i add them to the project? – Sara Bony Jul 12 '12 at 09:12
  • I copy the source files of library into source of my project, but it doesn,t work. – Sara Bony Jul 12 '12 at 09:51
0

The problem has been solved. As davek said we can only do line-by-line debugging in NetBeans for a library (package) if we have the source code for that package, and for adding it in NeatBeans :

  1. right click on project and go to "Properties"

  2. in the window that appear choose "sources" on the left

  3. on the right of window, under "source package folder" click on "add folder" then add the root directory for the source code.
Sara Bony
  • 31
  • 1
  • 8