IntelliJ IDEA enables running entire applications as well as classes with a main() method .

IntelliJ IDEA makes use of the settings defined in a Run/Debug Configuration. All the run configurations that exist in a project, are available in the Select Run/Debug Configuration drop-down list:

img

Running an application

To run an application, follow these steps:

  1. On the main toolbar select the desired run configuration, and do one of the following:
    • Select Run | Run from the main menu.
    • Click img.
    • Press ⌃R or ⌃R⇧F10 or ⇧F10⇧⌘F11 or ⇧⌘F11^ F5, ⌃F5 or ⌃F5⇧ F10, ⇧F10 or ⇧F10.

Alternatively, press ⌃⌥R or ⌃⌥R⌥⇧F10 or ⌥⇧F10⌃⌥R or ⌃⌥R⇧ ⌥ F10, ⌥⇧F10 or ⌥⇧F10⇧ ⌥ F10, ⌥⇧F10 or ⌥⇧F10, select the desired run configuration from the pop-up menu, and press or or or Enter, or Enter, ^ M, , ⌃M, or ⌃M.

altShiftF10

From this pop-up menu you can:

  • Invoke the Edit Configuration dialog.
  • Edit the selected configuration before launch (⌘↓, F4, ⌘↓ or F4F4 or F4F3 or F3F4, F4 or F4F4, F4 or F4).
  • Instantly delete a temporary configuration (, , ⌘⌫, , or ⌘⌫, , ⌘⌫, , or ⌘⌫, , ⌘⌫, , or ⌘⌫Delete, or Delete, ^ D, , ⌃D, or ⌃D).
  • Switch from run to debug and vice versa (hold).
  • Access a previously selected configuration (1).
  • Access context-dependent configuration (2 or 3).

This pop-up menu can also be quickly accessed by pressing F9, when you're not running any debug session.

Note that after you've started a run session, the run icon that marks the Run tool window and in the Run/Debug Configuration Selector toggles to active_run_icon to indicate that the run process is active.

If you want to see a list of all currently running applications, select Run | Show Running List from the main menu. A popup listing all active applications will be displayed in the top-right corner of the editor.

Running a class with a main() method

To run a class with a main() method, follow these steps:

  1. Open the class in the editor and choose Run <method name > on the context menu or press ⌃⇧R or ⌃⇧R⌃⇧F10 or ⌃⇧F10⌃⇧R or ⌃⇧R^ F9, ⌃F9 or ⌃F9^ ⇧ F10, ⌃⇧F10 or ⌃⇧F10.
  2. Select the class in the Project tool window and choose Run <method name > on the context menu of the selection.

See Also

Procedures:

Reference:

Concepts: