The Wolfram Workbench supports launching of J/Link projects in run and debug modes. This is useful since it lets you debug both your Mathematica and Java code at the same time.
You first need to start with a J/Link project. Then you need to create a launch configuration manually. Typically, when you run or debug Mathematica code, this is done automatically, but in this case it must be done manually.
From the menu bar use
Run > Debug..., select Wolfram Workbench,
and click the New launch configuration button. You can fill in
the name of the configuration, choose a J/Link project,
and then set the name of the file to run from, typically a
.nb file. After this, the dialog should look similar to the
following.
Now, you should click the New button to create an associated Java launch configuration. When you do this you should save the Mathematica launch you just created. The Java launch configuration is set up to connect via J/Link to Mathematica.
Return to the Mathematica launch and select the Java launch
in the drop-down menu. After this, the dialog should look similar to the
following.
Now you can click Debug. This will launch both Mathematica
and Java and connect them together using J/Link. You will be able
to set breakpoints in both Mathematica and Java, and observe the
state of both systems. You can confirm that both launches are running
by looking in the Debug view. This should look similar to the following.
If you find that the functionality described in this page does not work, make sure that your project is set up as a J/Link project, as described in the J/Link project section.