IntelliJ IDEA 2016.2 Help

Working with Server Run/Debug Configurations

To run or debug your Java EE or Web application on an application server, you need an application server run/debug configuration.

One such configuration may be created by IntelliJ IDEA automatically. This happens if you, when creating a project or module, specify an application server that you are going to use (see Defining a server when creating a project or module).

You can create more server run/debug configurations if and when needed.

Local and remote run configurations

A server run/debug configuration may be local or remote.

Local configurations are for servers installed on your computer. Such configurations include the settings that define how the corresponding server is to be started. Consequently, when you execute a local configuration, IntelliJ IDEA, among other things, starts the server.

Remote configurations don't start a server. Usually, they are used for servers running on different (remote) computers. They may as well be used for servers installed locally (on your computer) in cases when you don't want the run configuration to start (or stop) the server.

When you execute a remote configuration, IntelliJ IDEA connects to the server to be able to deploy application artifacts or to perform their debugging. At that time, the corresponding server must already be running.

To conclude, what principally distinguishes local and remote configurations is not where the server is physically installed (though this is also important) but whether or not the server is started (or stopped) by means of the corresponding run configuration.

What happens when a server run configuration is started

When you start a server run/debug configuration, IntelliJ IDEA, usually, does the following:

  1. Performs the Before launch tasks. By default, these are Make and Build Artifacts: IntelliJ IDEA compiles the project and builds the application artifacts. The Build Artifacts task is not initially present in a run configuration but added automatically as soon as you specify the artifacts to be deployed onto the server.
  2. Starts the server (for a local configuration) or connects to the server (for a remote configuration). (At that moment, the Run or the Debug tool window opens so that you can monitor and control the process.)
  3. Deploys the specified artifacts (and/or deployable components external to your project) to the server.
  4. If so specified, starts a web browser and opens a specified URL (which usually corresponds to a starting page of your application).

Creating a server run/debug configuration

  1. Open the Run/Debug Configurations dialog (e.g. Run | Edit Configurations).
  2. Click add (Alt+Insert), select the server of interest (e.g. Tomcat Server) and, if available, select Local or Remote. (See Local and remote run configurations.)
  3. In the right-hand part of the dialog, specify the run/debug configuration settings and click OK. (For information on the available settings, see the corresponding server-specific topic in Run/Debug Configurations).

See also, Creating and Editing Run/Debug Configurations.

Starting a server run/debug configuration

An application server run/debug configuration can be started in a usual way, as any other run configuration. See Running Applications and Starting the Debugger Session.

Alternatively, you can use the Application Servers Tool Window:

  1. Open the Application Servers tool window (e.g. View | Tool Windows | Application Servers).
  2. Select the server run/debug configuration that you want to use.
  3. On the toolbar of the tool window, click:
    • run to start the selected configuration in the run mode.
    • debug to start the selected configuration in the debug mode.

    As a result, the Run or the Debug tool window opens.

See Also

Last modified: 23 November 2016