In jbuilder9, you can display the current line code error in the editor, but does not display logically errors, as well as running errors, so you need to further understand how to make error checks and debug, to troubleshoot logic and Running error. First, you have to make a breakpoint setting. The method is very simple. When you click on any row of statements in the editor, you will automatically set this line to breakpoints. The above breakpoint is just the simplest discontinuation point, and there are other types of breakpoints. There are 5 types of breakpoints:
Line is thrown before the code-specific line of code is executed.
Exception is thrown when the code throws a specific exception
Class
Method is triggered when it reaches the method of being set to breakpoint.
Cross-Process
Different debuggers support different breakpoints. Some generic types are: Direction is initiated before the code is executed in the code. The method breakpoint is initiated when the method reaches the desired breakpoint. The count breakpoint is thrown an abnormal breakpoint when a counter reaches a certain particular value. When the code throws a specific anomaly, it is raised when the content stored in the specific address range is modified. The address set to breakpoint is triggered. Note: Some debuggers only support certain breakpoint types only on the Java code (code generated by Just-In-Time compiler) without supporting interpretation code (use The code generated by the JavaC tool). An example is the address breakpoint. Each tool may be somewhat different in the way you can set a breakpoint. Check the documentation for your tool.
The user can also display the error file Project menu item to enter the program's debugging interface by selecting Debug in the Run menu. When debugging and running the program, the error is displayed (the text of the red part), where the name and the program line, click this section, and will be cut into the file in the editor, and display the error of the error with the error. When the user needs to observe the object, first add observation objects, the method is to click the Add Watch menu item in the RUN menu, then find the breakpoint of the object, and then run the debug project to the debug state.
You may ask, how do I know where to place breakpoints? If you don't feel at all about this problem, you can set breakpoints in the main () method to generate stack reputation (Stack TRACE), set breakpoints in the program generated. You will see the line number of the problem in the source code in the stack. If your output or graphic display is not properly displaying predetermined information (such as text domain display error text), you can set breakpoints in the component created. Then you can write your program to display the value related to the GUI object. Experience will set breakpoints in the most suitable place. You can set multiple breakpoints in a class or program.
The terms that are often encountered when debugging procedures are: enter the execution of the current line. If the current row contains a method call, execute the first line of the called method. If the method in the class is compiled with options without debugging (not using the -g option), you will see the No Source Available message. Crossing the current row without stopping a method or routine because the line calls. Returns the row that is executed from the current execution point and returned to the call current method.
Stack Traces This When the Java program is built in the Core Dumps, it produces what we calls the stack reprittion (Stack TRACE) when the Java program is built. The stack is written to tell the developer program's exact path. It will explain the number and method names and the number of rows in the source code (if you compile using debug options). If you start debugging at the beginning of the stack copy, you can view your code backwards to see what is actually the declaration. This is a solution to the rapid discovery process. You can also use one of the following methods to manually enforce the stack. Throwable (). PrintStackTrace () Generates stack repartitions in calling the point. Dressing will display the thread involved in the method. Thread.currentthread.dumpstack () only generates a snapshot of the current thread. When you need to understand what your program will generate a stack, use forced to write. The following program is an example of a forced stack. This program is filed for file copy. By comparing whether the length of the two files is equal to whether the copy is successful. If we don't wait, we write to the file and then force the print stack to write (see the declaration of the black body). Throwable () is a class in java.lang. PrintStackTrace () is a method of throwable (), which prints the program execution path. Diagnostic Method Java Language provides methods in the Runtime () class to track your method calls to JVM. These tracking will generate a list of you call every method of the JVM byte code. Note that this list can generate a large number of outputs, so use it in a small section of your code. Open tracking can be added to the code: TraceMethodCalls (TRUE) Close Using: TraceMethodCalls (false) Opens the JVM and observes the output of it to the standard output.