Using the debugger in Netbeans 6.1, I'd like to step into a method of the JSF library (specifically method saveSerializedView of class StateManager), but I cannot figure out how to specify through the IDE the location of the source code for the JSF library. I'm even having trouble determining which jar file or files Netbeans is using for JSF.
Right click, and from the context menu select Navigate > Go to Source and you should be redirected to the appropriate position within the source of the JDK class. Alternatively, press Ctrl + Shift + B.
NetBeans, like most other programming environments, provides a particular tool for this called a debugger. Debugging can be defined as the process used for examining the code for errors. Debugging is carried out by setting breakpoints in code and then using debugger to run it.
This answer applies to Netbeans 6.1 circa September 2008:
It sounds as if you need to explore the "Libraries" dialog. Select "Tools" from the menu bar and "Libraries" from the menu. If you select "JSF" on the left, you'll see an association of jar files, sources (currently none in my Netbeans 6.1) and javadoc (which shows javaee5-doc-api.zip in my Netbeans).
What you need to do is add a new zip or jar of source files under the "Sources" tag.
An example of a fully populated library is the "Swing Layout Extensions" which has a jar file, sources and javadoc.
I take it your jars don't include the source, since you can't "step into." In cases like these what I do is find the appropriate source (just StateManager.java in this case, if it's available, or jars that include source), taking care that it is the version I'm using. Inside my project tree, I create the package hierarchy to that specific class, and put that source in there. Even if the class exists in a jar, I can use this source to set breakpoints, etc.
Example for Netbeans7 and Mojarra 2.0.3
Create a new library(Tools->Libraries), call it for example Mojarra-2.0.3.
In the classpath tab add the 2 mojarra jars:
In the sources tab, add two paths:
..\mojarra-2.0.3-FCS-source\jsf-api\src\main\java\
..\mojarra-2.0.3-FCS-source\jsf-ri\src\main\java\ Add the new created library to the project
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With