7 Building, Running and Debugging Applications

This chapter provides an overview of the building, running, and debugging features in JDeveloper. These features are explained in greater detail in the subsequent chapters of this guide.

This chapter includes the following sections:

7.1 About Building, Running and Debugging Applications

After you have completed the design time aspects of your application, you are ready to build, run, and debug your project.

JDeveloper provides three ways to build projects: using the Make and Rebuild, Apache Ant, or Maven.

When you run your project, the Processes window manages the processes that are run, debugged, or profiled. The Processes window is automatically displayed when two or more such processes are active at the same time,. When a process has completed, it is automatically removed from the Processes window.

The debugger enables you to investigate your code, and identify and fix problem areas. Two types of debugging are available: local and remote debugging.

7.2 Building Applications

You can build your application using one of these ways:

Additionally, you can also clean your application and generate Javadoc for it.

7.2.1 Make and Rebuild

The Make and Rebuild commands execute standard operations for compiling projects in JDeveloper.

Make operations compile source files that have changed since they were last compiled, or have dependencies that have changed. Rebuild operations, in contrast, compile source files unconditionally. You can invoke make on individual source files, on working sets, or on containers such as packages, and projects.

7.2.2 Apache Ant

Apache Ant is a build tool similar in functionality to the Unix make utility. Ant uses XML formatted buildfiles to both describe and control the process used to build an application and its components. Ant supports cross-platform compilation and is easily extensible. Apache Ant is a product of the Apache Software Foundation. For more information, see the website http://ant.apache.org/index.html.

For more information about Apache Ant, see Section 12.6, "Building with Apache Ant".

7.2.3 Apache Maven

Apache Maven is a software project management and comprehension tool. Maven can manage a project's build, reporting and documentation from a central piece of information, the project object model (POM). You can build the project using its POM and a set of plugins that are shared by all projects using Maven, providing a uniform build system.Maven can be extended by plugins to use a number of other development tools for reporting or the build process. For more information about Maven, see http://maven.apache.org/index.html.

For more information about Apache Maven, see Section 12.7, "Building and Running with Apache Maven".

7.3 Running Applications

JDeveloper offers several techniques to monitor and control the way applications are run. The Processes window enables you to manage all running processes.

7.3.1 Processes window

The Processes window keeps track of processes that are run, debugged, or profiled. When two or more such processes are active at the same time, the Processes window is automatically displayed. When a process has completed, it is automatically removed from the Processes window.

For more information about the Processes window, see Section 14.2, "Understanding the Processes Window".

7.4 Debugging Applications

JDeveloper provides you with a comprehensive debugger to assess and repair your code. Debugging can be of two types -- local and remote.

A local debugging session is started by setting breakpoints in source files, and then starting the debugger. When debugging an application such as a servlet in JDeveloper, you have complete control over the execution flow and can view and modify values of variables. You can also investigate application performance by monitoring class instance counts and memory usage. JDeveloper will follow calls from your application into other source files, or generate stub classes for source files that are not available

Remote debugging requires two JDeveloper processes: a debugger and a debuggee which may reside on a different platform. Once the debuggee process is launched and the debugger process is attached to it, remote debugging is similar to local debugging.

7.4.1 How to Use the Debugger

The Debugger provides a number of special-purpose debugging windows that enable you to efficiently identify the problematic areas in your code.

You can control what type of information is displayed in each of the debugger windows. To see what options are available in each window such as which columns to display, right-click in a window and choose Preferences from the context menu. Or, you can choose Tools > Preferences from the main menu and expand the Debugger node to display a preferences page for each debugger window. You can also save the debug information as text or HTML output file.

For more information on using the debugger, see Section 14.8, "Using the Debugger Windows".

7.4.2 Technologies that Use Debugging

Several technologies use debugging facilities provided by JDeveloper. The following table lists these technologies and the corresponding link to their debugging documentation.