Top
Interstage Studio User's Guide
FUJITSU Software

10.1.5 Build and Debugging

Problems View Filter Function

When many problems are displayed in the Problems view, users can select [Configure Filters] from the upper-right menu of the view to customize the contents displayed.
The following filter functions are available:

Ant Invocation During Build

Ant can be invoked during a build by coding an Ant script and setting it as follows:

  1. Select [Builders] from the project properties.

  2. Click [New], then select [Ant Builder] in the [Choose configuration type] dialog box.

  3. In [Build file] under [Main], specify the Ant script file to be used.

  4. If updating files that are in the Workspace with an Ant script, in the [Refresh] tab, specify the resources that should be updated after the Ant script has executed.

  5. Under the [Targets] tab, the target can be set to suit the manual build, automatic build, or other build mechanism.

  6. The properties required for Ant execution can be specified from the [Properties] tab.

Point

The Ant script can be debugged by selecting the Ant script, then selecting [Debug As] > [Ant Build] in the context menu.

Adding Classpaths

When adding a JAR file that is not in the Workspace to a classpath, the environment-dependent part can be absorbed using either of the methods below. This improves project resource portability.

Classpath variable

On the preference page, use [Java] > [Build Path] > [Classpath Variables] to associate and manage names and paths.
To add to the classpath, select project properties, then [Java Build Path], then the [Libraries] tab, then use the [Add Variable] button. In the displayed dialog box, select the classpath variable then, from the [Extend] button, select the resource from under the path that is associated with the classpath variable.

User library

On the preference page, use [Java] > [Build Path] > [User Libraries] to associate and manage a name and multiple JAR files. This is useful when specifying a library group.
To add to the classpath of a specified library, select project properties, then [Java Build Path], then the [Libraries] tab, then use the [Add Library] button.

Performing Build using isstudiobld.exe

Use the isstudiobld.exe tool to build a project from the command line without launching the workbench. The isstudiobld.exe tool is in the following location:

   <Workbench installation folder>\eclipse\isstudiobld.exe

The method of using the isstudiobld tool is described below.

Format:

isstudiobld -data <workspace> [options] [<target> [<target2>...]]

Note: [] can be omitted.< > are used to specify the respective values.

Parameters:

-data <workspace>

Specify the workspace folder.

<target>

Specify the target of the Ant being executed.

Options:

-f <buildfile>

Specify the build file (Ant script).

When this option is omitted, use the build file at the following address.

<Installation folder>\IDE\1101\etc\build\buildAll.xml

-verbose or -v

Displays details.

-D<property>=<value>

Specify a property.

-propertyfile <name>

Load from a file where properties are specified.

-vm <JDK installation folder>\jre\bin

Specify a folder in which there is a JDK java.exe that executes the build file (Ant script).

When this option is omitted, use the JDK specified in the environment variable PATH.

Note

  • Use the eclipse.incrementalBuild ant task to build the project.

  • In the eclipse.incrementalBuild Ant task, build the project according to the [JavaCompiler] and [Java Build Path] information specified in the project.
    In the Ant tasks except eclipse.incrementalBuild, use the JDK that -vm option specifies.

The method for using the eclipse.incrementalBuild Ant task is shown below.

Attributes

Description

kind

The build type. Specify either incremental, full, or clean. The default value is incremental.

project

The project to be built. If omitted, a build of the Workspace is performed.

Example: Perform a full build of the Workspace.

  <eclipse.incrementalBuild kind="full" />

Example: Clean the project project1.

  <eclipse.incrementalBuild project="project1" kind="clean" />

Temporary Disablement of Breakpoints

When many breakpoints are set, execution is interrupted at too many places and debug efficiency may deteriorate.

In this case, breakpoints can be disabled temporarily without releasing the breakpoints. When [Group By] > [<Grouping Method>] is selected from the upper-right menu of the Breakpoint view, the breakpoints are grouped and therefore can be disabled together as a group.
Alternatively, [Skip All Breakpoints] can be selected from the Breakpoint view toolbar to disable all breakpoints.

Exception Breakpoints

Users may want to interrupt program execution if an exception has occurred. If so, use an exception breakpoint. From the menu, use [Run] > [Add Java Exception Breakpoint] to specify an exception class. This sets a breakpoint that interrupts execution when that exception has occurred.

Step-in to selected Method

During debugging, when step-in execution is performed for a statement such as,

addValue(obj.getName(), obj.getValue());

step-in is performed in the following sequence when a simple step-in (F5) is executed:

  1. Step-in to obj.getName()

  2. Step-in to obj.getValue()

  3. Step-in to addValue()

If you want to step-in only to addValue(), select "addValue" on the editor, then select [Step Into Selection] from the menu. This performs 3. immediately without performing 1. and 2.

Expression Evaluation

In addition to checking the object contents, users may want to test method execution during debugging.
If so, enter the expression in the Display view or the details frame of the Variables view and select the expression, then select either [Display], [Inspect], or [Execute] from the context menu.

Specifying the Java Version Used for Build and Debugging

The JRE System Library specified in the project build path is used to determine the Java version used for build and debugging. You can specify the Java version by configuring the JRE System Library of the project.

Specify the Java version with the JRE System Library as follows:

To configure the JRE System Library of a project, follow the procedure below.

  1. Select a project from the Package Explorer view or the other views.

  2. Select [Properties] from the context menu, or select [File] > [Properties] from the menu bar. The [Properties] dialog box appears.

  3. Select [Java Build Path] in the left pane. The [Java Build Path] page is displayed.

  4. Select the [Libraries] tab.

  5. Select [JRE System Library] from the [JARs and class folders on the build path] list, and click [Edit]. The [Edit Library] dialog box appears.

  6. Select [Workspace default JRE] or [Alternate JRE] from the System Libraries. If [Alternate JRE] is selected, select the Installed JRE to be used from the combo box.

To add JDK to the installed JRE, follow the procedure below:

  1. From the workbench menu, select [Window] > [Preferences].

  2. In the [Preferences] dialog box on the left pane, select [Java] > [Installed JREs].

  3. In the right [Installed JREs] window, click [Add].

  4. In the [JRE Type] window, select "Standard VM", then click [Next].

  5. In [JRE home] of the [JRE Definition] window, specify the JDK installation folder. A name in accordance with the folder name selected in [JRE name] is displayed, and a list of JAR files for the JDK library specified in [JRE system libraries] is displayed. Click [Finish] to close the window.

Note

  • Though [Execution Environment] is included as a System Library option, you cannot use it in Interstage Studio.

  • Do not set a compiler compliance level that is higher than that of the Java version specified in the JRE System Library used.

Point

In Java compilation, you can specify Compiler compliance level, such as class files compatibility and Source compatibility, etc. You can specify compiler compliance level on the [Java Compiler] page of the project properties or on the [Java] > [Compiler] page of the workspace preferences.

Stack Trace View

The Stack Trace View can be used to read FJVM logs or thread dumps collected by the thread dump tool and to produce a hierarchical display of the list of registered threads and stack traces.

Use the following procedure to display the Stack Trace View:

  1. Select [Window] > [Show View] > [Other] from the menu bar.

  2. Select [Java] > [Stack Trace] in [Show View] dialog box.

See

For details on FJVM logs, refer to the "Interstage Application Server Tuning Guide" > "JDK/JRE Tuning".

Note

  • The Stack Trace View cannot be used in the Java EE 6 workbench.

  • The thread dump files that can be displayed by the Stack Trace View are those that were output with the thread dump tool "-f" option specified (thread dump output destination specified). Standard output thread dump files and thread dumps registered in application server log files cannot be displayed.

The Stack Trace View has the following functions:

If a thread dump contains monitor information and [Show Monitors] is turned on, the following elements are displayed.

Element

Icon

Description

Monitor owned by the thread

Displayed as a child of the thread. It represents a monitor owned by the thread. The class name and ID of the object acting as the monitor are displayed to the right of the icon. If the thread owns multiple monitors, as many instances of this element as the number of these monitors are displayed.
If the monitor is in the deadlock state, the right icon is displayed.

Thread that is waiting for the monitor

Displayed as a child of a monitor owned by the thread. It represents a thread that is waiting for the monitor. The thread name and information indicating whether the thread is a system thread are displayed to the right of the icon. If multiple threads are waiting for the monitor, as many instances of this element as the number of these threads are displayed.
If the thread is in the deadlock state, the right icon is displayed.

Monitor for which the thread is waiting

Displayed as a child of the thread. It represents a monitor for which the thread is waiting. The class name and ID of the object acting as the monitor are displayed to the right of the icon.
If the monitor is in the deadlock state, the right icon is displayed.

Thread that owns the monitor

Displayed as a child of a monitor for which the thread is waiting. It represents a thread that owns the monitor. The thread name and information indicating whether the thread is a system thread are displayed to the right of the icon.
If the thread is in the deadlock state, the right icon is displayed.

Monitor locked

Displayed between stack trace entries to identify the process where a monitor became locked. The class name and ID of the object acting as the monitor are displayed to the right of the icon.