Debug Project New and Noteworthy for 3.3M6


Launch selection vs. launch last

Running and debugging applications has been simplified to run or debug the selected file or active editor. Use the "Run/Debug > Launching > Launch the selected resource or active editor" preference to enable this behavior. When the selected resource (or active editor) is not executable, you can opt to launch the associated project by selecting "Always launch project if selected resource cannot be launched".

Preference for launch selection vs. launch last

Pressing the Run or Debug toolbar button will launch the selected resource (as will the Run or Debug action in the top level Run menu). When no launch configuration exists for a file and there is only one way to launch it, the file will simply be launched in the mode you selected. When there is more than one way to launch a file you will be prompted to select how to run or debug the application. For example, when running a JUnit test you can run as a Java application or JUnit test. A a launch configuration will be created and an entry will be added to the launch history for the application.

Select a way to run the application

When the same resource is launched again, the most recent configuration in the launch history associated with that resource is re-launched.


Run/Debug settings

A new properties page has been added to manage launch configurations associated with a resource. For example, selecting the "Run/Debug Settings" property page for a project will display all launch configurations associated with that project. Configurations can be created, deleted, and edited from this page.

Run/Debug Settings property page


Hyperlink stepping

When debugging you can use hyperlinks to step into a method. Use the "Ctrl-Alt" keys to step into the method (rather than "Ctrl" which will navigate to the source code).

Step into using hyperlink (Ctrl+Alt)


Force early return

You can force an early return from a method (only available when debugging on a J2SE6 virtual machine). This returns a value from the current stack frame without executing any more instructions in the method and releases any locks obtained by synchronized blocks. A return value is created by selecting an expression and "Force Return (Alt-Shift-F)". This action is available from the Java editor's context menu, top level Run menu, in the Display view, and in the detail pane of the Variables view.

For example, if a method was going to return false you could for return a value of true by selecting an expression in the Display view and invoking "Force Return". Forcing an early return from a void method does not require an expression to be selected.

Code snippet that would return 'false'

Force return value of selected expression


Browse object references

You can browse all references to an object (only available when debugging on a J2SE6 virtual machine). Object references can be displayed in the variables view by toggling the "Show References" setting in the view menu. References to an object are grouped in a collection named "References".

Show references in variables view

References can also be displayed in a popup by selecting an object in the variables view and selecting "All References..." from the context menu.


Browse all instances

You can browse all instances of a type (only available when debugging on a J2SE6 virtual machine). Instances are displayed in a popup by selecting a type in the editor outline, a type name in the Java editor, or a variable in the Variables view and selecting "All Instances..." from the context menu.


Step through filters vs. step return

You can configure step filters to always return from a filtered location or step through to a non-filtered location. For example, if java.util is a filtered location, stepping into code in HashMap could result in a call back to your application code to check the equality of an object. If you choose to "Step through filters" a step into would end up in your application code. However, when the "Step through filters" option is disabled, a step into HashMap would behave like a step over.

Use the "Step though filters" preferences setting on the "Java > Debug > Step Filtering" preference to toggle the feature.


Export logical structures

You can now export and import logical structure preferences separate from other workspace preferences.

Export logical structures