Full-function integrated Java debugger allows you to debug your projects right inside Together.
Breakpoints: Enables you to
stop at any line of the source code including "Logging" and
"Pass Count" features. Provides 4 kinds of breakpoints:
line, exception, class and method breakpoints.
Command execution:
"Run", "Pause, "Continue", "Stop"
commands available. For debugging methods there are "Step
over", "Step into", "Step out" and "Run
to the end of method" facilities.
Watch: You
can watch/modify expressions, variables, and class members.
Threads:
Enables browsing the state, methods and variables of a thread.
Classes: This
feature enables you to specify classes that should be skipped. Shows
the classes that are already loaded.
Remote process: Enables attaching to a remote process, by specifying address and transport.
There are several ways to access the debugger commands:
Main menu: Tools | Run/Debug
Debugger toolbar
(Can be accessed using Tools | Run/Debug | Show debug tab menu command)
Hot key shortcuts
Tip: Before starting a debugging session be sure you've set up all the needed breakpoints. For more information see Working with breakpoints.
To start a debugging session choose Tools | Run/Debug | Run in debugger menu command (hot key is Shift-F9). This starts your projects in debug mode and automatically shows Debugger Tab. Debugger Tab significantly speeds up access to the information you could need during the debugging process.

Debugger tab has its own elements:
Console tab: Displays Java console
Threads tab: Threads viewer. Displays in details
all the running threads.
Classes tab: Displays a loaded classes hierarchy.
Monitors tab: Displays synchronization monitors.
Watches tab: Watch window for class members/expressions.
Breakpoints tab: Displays list of breakpoints.
Skip classes tab: Contains list of "disabled
for debug" classes.
Toolbar: Provides mouse-click access to the debugger commands, such as "Pause", "Resume", "Reset", "Step over", "Step into", etc.
When a debug session starts, you have to control the program execution, using the following set of control commands:
|
Command |
Icon |
Description |
Hot |
|
Pause |
|
Pauses program and passes control to the debugger. |
|
|
Continue |
|
Resumes program execution. |
|
|
Stop program |
|
Terminates the program and debugging session. |
Shift-F2 |
|
Run to cursor |
|
Resumes program and breaks before cursor. |
F4 |
|
Step over |
|
Skips debugging of a method that is currently under cursor. The method executes and returns result. |
Shift-F8 |
|
Step into |
|
Forces debugging of a method that is currently under cursor. Debugger stops at the first line of this method. |
Shift-F7 |
|
Step out |
|
Forces current method execution and stops in the current method's caller at the next line after call. |
|
|
Run to end of method |
|
Forces current method execution and stops before return. |
|
|
Toggle smart step |
|
Debugger performs a "smart step". You can set up smart step abilities using "Debugger" tab of the Options Dialog. |
|
Tip: For fast access to these commands use hot keys or the Debugger Tab toolbar.
Breakpoints provide the most powerful debugging facility, which makes it possible to break program execution at the specified place, in order to inspect variables, class members, etc.
There are several methods of setting up breakpoints within the Editor:
Select the line of code you want set up breakpoint at, and...
Press F5 key.
Right click on the line and select "Toggle breakpoint" on the speedmenu.
Click one of the breakpoint buttons of the Debugger Tab toolbar.
Or just click on left margin next to the this line. (See also: User's Guide: Using the Editor: Setting breakpoints)
"Breakpoints" tab of the Debugger Tab provides a toolbar enabing full control of breakpoints. You can:
Disable all breakpoints
Enable all breakpoints
Remove all breakpoints
Edit breakpoint properties
Go to breakpoint
Disable/Enable breakpoint
Remove breakpoint
Add line breakpoint
Add exception breakpoint
Add class breakpoint
Add method breakpoint
When you choose "Breakpoint properties" command, the following dialog is displayed.

Using this dialog you can specify if there should be a stop execution at this point, specify number of passes through this breakpoint before stop, and also whether this stop should be logged or not.
When staying at the breakpoint you can examine data using "Add watch" command, available from "Tools | Run/Debug" menu and from the Debugger Tab toolbar.
Watching class members, inspecting objects etc. is an important side of the debugging process. Select Tools | Run in Debugger on the Editor speedmenu or on the main menu.

This will open Debugger tab with the full set of elements, and show "Add Watch" command on the Editor speedmenu. Now you can add watch on the Watches tab of the Debugger, or from the Editor speedmenu.


Specify the expression you would like to watch and its description (optionally). This expression displays on the "Watches" tab of the Debugger Tab.
From the context menu of "Watches" tab you can:
Change watch expression
Change watch description
Remove watch
Together allows access the variables in course of program execution. Set breakpoint in the desired location of your code and select Tools | Run in Debugger on the Editor speedmenu or on the main menu. This adds Evaluate tab to the Debugger pane and Evaluate/Modify command to the Editor speedmenu.
While your program runs in the Debugger, you can check the value of each object. To do this, you need only navigate the cursor to the desired object, and after a small delay the description of this object will show up. The form of presentation is defined by the Use structured context evaluation flag in the Options | Debugger. If the flag is set (by default), evaluation window shows the entire structure and value of an object.

If this flag is cleared, evaluation window shows object's address or value only:


It is also possible to evaluate and modify objects in the Evaluate tab of the Debugger pane. To do this, select Evaluate command on the Editor's speedmenu and specify variable or expression to be evaluated/modified.

Appropriate entry adds to the Evaluate tab, showing location, type and value of the object in question.

You can change the value of variables, typing directly in the Expression field of the tab. Click arrow icon for the changes to take effect.

Note: you can only evaluate and modify objects within the current debugging context. If you try to check an object past the breakpoint, the Result field will report that the variable is out of range.
You can remotely debug Java programs with the integrated debugger. Start the external Java program to be remotely debugged (debugged per attach) in the following way:
java ... -Xdebug -Xnoagent -Djava.compiler=NONE --> -Xrunjdwp:transport=dt_socket,address=8787,server=y,launch="%1\bin\win32\display.bat %1"
If port 8787 is not convinient for you, you could allow the JVM to define the port:
-Xdebug -Xnoagent -Djava.compiler=NONE --> -Xrunjdwp:transport=dt_socket,server=y,launch="%1\bin\win32\display.bat%1"
In the latter case, the JVM prints the address. Note the address and enter value in the debugger attach dialog.
See also:
Using the editor
Debugging an Applet
Debugging a Servlet
Debugging a JSP