# Start the debugger session

Starting a debugger session is very similar to running the program in normal mode. The debugger is attached behind the scenes, so you don't have to configure anything specific to start a debugger session. If you are able to run your program from IntelliJ IDEA, you will also be able to debug it using the same configuration.

> **Note:**
> While IntelliJ IDEA provides a way to debug simple applications without any extra setup, some tasks require working with [run/debug
> configurations](run-debug-configuration.html), just like with regular running of the program.

Each time you debug a program, the debugger session is based on a [run/debug configuration](run-debug-configuration.html).   It allows you to configure parameters and actions for launching the application. For example, you can specify to build the application every time you start a debugger session or use the previously compiled code.  You can also use any VM options, custom classpath values, and so on (as long as the selected run/debug configuration supports this).

Procedure:

* To run the program from an entry point, such as the main() method or a test, click Run  ![Run icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.runConfigurations.testState.run.svg)   icon in the gutter near it and select Debug.

![A menu appears on clicking the run button in the gutter](https://resources.jetbrains.com.cn/help/img/idea/2026.2/debug_run_menu.png)

This will create a temporary run/debug configuration for you. After that, you can customize and save this temporary configuration if needed.  This is the quickest way to debug your program without configuring the startup parameters.

* If you already have a run/debug configuration, select it in the [run
widget](guided-tour-around-the-user-interface.html#toolbar), then click Debug or press `Shift+F9` (Windows), `⌃ D` (macOS), `⇧ F9` (IntelliJ IDEA Classic (macOS)), `⌥ ⇧ D` (macOS System Shortcuts), `Shift+F9` (XWin), `Shift+F9` (GNOME), `Shift+F9` (KDE), `Shift+F9` (Emacs), `Shift+F9` (Sublime Text), `⌃ D` (Sublime Text (macOS)), `Ctrl+F5` (NetBeans), `Alt+F5` (Visual Studio), `⌥ F5` (Visual Studio (macOS)), `Alt+Shift+D` (Eclipse), `⌘ F11` (Eclipse (macOS)).

![Run widget on the main toolbar](https://resources.jetbrains.com.cn/help/img/idea/2026.2/debug_configurations_menu.png)

* To launch a debug session for an existing run/debug configuration from the editor, press `Alt+Shift+F9` (Windows), `⌃ ⌥ D` (macOS), `⌥ ⇧ F9` (IntelliJ IDEA Classic (macOS)), `⌃ ⌥ D` (macOS System Shortcuts), `Alt+Shift+F9` (XWin), `Alt+Shift+F9` (GNOME), `Alt+Shift+F9` (KDE), `Alt+Shift+F9` (Emacs), `Alt+Shift+F9` (Sublime Text), `⌃ ⌥ D` (Sublime Text (macOS)), `Alt+Shift+F9` (NetBeans), `Alt+Shift+F9` (Visual Studio), `⌃ ⌥ D` (Visual Studio (macOS)), `Alt+Shift+F9` (Eclipse), `⌃ ⌥ D` (Eclipse (macOS)) and select it from the menu.

![Debug menu lets you select a configuration to debug or edit configurations](https://resources.jetbrains.com.cn/help/img/idea/2026.2/debug_select_configuration.png)

If you are debugging code that is based on a framework or runs on an application server, it is recommended to use the run/debug configuration type intended for this type of application. When you launch a debug session, IntelliJ IDEA adds a VM option that allows the debugger to attach. Given that a particular framework may fork the process, there is no guarantee that the target process will get the required VM option if an improper run/debug configuration type is used.

Procedure: Pause/Resume a debugger session

When the debugger session is running, you can pause/resume it using the buttons on the toolbar of the Debug tool window:

* To pause a debugger session, click ![the Pause button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.actions.pause.svg).

* To resume a debugger session, click ![the Resume button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.actions.resume.svg) `F9` (Windows), `⌘ ⌥ R` (macOS), `F9` (IntelliJ IDEA Classic (macOS)), `⌃ \` (macOS System Shortcuts), `F9` (XWin), `F9` (GNOME), `F9` (KDE), `F9` (Emacs), `F9` (Sublime Text), `F9` (Sublime Text (macOS)), `F5` (NetBeans), `F5` (Visual Studio), `F5` (Visual Studio (macOS)), `F8` (Eclipse), `F8` (Eclipse (macOS)).

> **Note:**
> Pausing the program is not an alternative to using [breakpoints](using-breakpoints.html) as this method doesn't let you use the full range of debugger functionality. For example, you cannot evaluate expressions after pausing the program.

Procedure: Restart a debugger session

* Click the  Rerun button in the Debug tool window or press `Ctrl+F5` (Windows), `⌘ R` (macOS), `⌃ F5` (IntelliJ IDEA Classic (macOS)), `⌘ R` (macOS System Shortcuts), `Ctrl+F5` (XWin), `Ctrl+F5` (GNOME), `Ctrl+5` (KDE), `Ctrl+F5` (Emacs), `Ctrl+F5` (Sublime Text), `⌘ R` (Sublime Text (macOS)), `Ctrl+F5` (NetBeans), `Ctrl+Shift+F5` (Visual Studio), `⌥ ⇧ F5` (Visual Studio (macOS)), `Ctrl+F11` (Eclipse), `Ctrl+F5` (Eclipse (macOS)).

![the Rerun button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/debug_rerun.png)

Procedure: Locate the process ID (PID) of the debug session

* To view the PID of the application you are currently debugging, hover over the corresponding session tab in the Debug tool window.

![A tooltip with process ID is shown on hovering a session tab in the Debug tool window](https://resources.jetbrains.com.cn/help/img/idea/2026.2/ij_debug_show_pid.png)

A tooltip appears that displays the PID of the debug session.

Procedure: Terminate a debugger session

* Click ![the Stop button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.run.stop.svg) in the Debug tool window.

Alternatively, press `Ctrl+F2` (Windows), `⌘ F2` (macOS), `⌘ F2` (IntelliJ IDEA Classic (macOS)), `⌃ ⇧ .` (macOS System Shortcuts), `Ctrl+F2` (XWin), `Ctrl+F2` (GNOME), `Ctrl+2` (KDE), `Ctrl+F2` (Emacs), `Ctrl+F2` (Sublime Text), `Ctrl+F2` (Sublime Text (macOS)), `Shift+F5` (NetBeans), `Shift+F5` (Visual Studio), `⇧ F5` (Visual Studio (macOS)), `Ctrl+F2` (Eclipse), `⌘ F2` (Eclipse (macOS)) and select the process to terminate (if there are two or more of them).

![the Stop button on the debugger toolbar](https://resources.jetbrains.com.cn/help/img/idea/2026.2/debug_stop_button.png)

## Debug multiple tasks

Procedure:

* To run or debug multiple tasks simultaneously, open the run widget menu in the toolbar and select the corresponding run/debug configurations while holding down the `Ctrl` (Windows), `Ctrl` (macOS), `Ctrl` (IntelliJ IDEA Classic (macOS)), `Ctrl` (macOS System Shortcuts), `Ctrl` (XWin), `Ctrl` (GNOME), `Ctrl` (KDE), `Ctrl` (Emacs), `Ctrl` (Sublime Text), `Ctrl` (Sublime Text (macOS)), `Ctrl` (NetBeans), `Ctrl` (Visual Studio), `Ctrl` (Visual Studio (macOS)), `Ctrl` (Eclipse), `Ctrl` (Eclipse (macOS)) key.

![%alt](https://resources.jetbrains.com.cn/help/img/idea/2026.2/debug-multiple-rc.png)

For launching multiple tasks using a single run/debug configuration, refer to [Run compound tasks](run-debug-multiple.html).

## Productivity tips

Debug non-responding applications
: In case [your
: application hangs](https://blog.jetbrains.com/idea/2021/10/unfreeze-your-apps/), it may help to pause the session and let the debugger get the information about the application's current state. You can then use this information to locate the cause of the problem.
:
:
:
: [Video](https://www.youtube.com/v/J1xLWRsnEf0)

Run before-launch tasks
: You can configure external tools or custom actions to run before a debugging session. Examples of before-launch actions are running a [Gulp](using-gulp-task-runner.html#ws_gulp_task_before_launch), [Grunt](using-grunt-task-runner.html#ws_grunt_task_before_launch), or [NPM](installing-and-removing-external-software-using-node-package-manager.html#ws_npm_run_as_before_launch_task) script, [compiling your TypeScript code into
: JavaScript](running-and-debugging-typescript.html#ws_ts_compile), or running all the currently active [File Watchers](using-file-watchers.html) to compile or compress your code, [uploading your sources](uploading-and-downloading-files.html) to a remote server, and many more, depending on the language and frameworks you are using.

