> Markdown version of [Running and Debugging](https://vaadin.com/docs/v25/tools/modernization-toolkit/swing-bridge/running-and-debugging). Section index: [llms.txt](https://vaadin.com/docs/v25/tools/llms.txt)

# <a id="swing-bridge.running-and-debugging"></a>Running and Debugging

## <a id="swing-bridge.running-and-debugging.cli"></a>Running from the Command Line

SwingBridge requires special JVM flags to access internal Java modules. Because of this, running the application through IDE requires configuring it with the required JVM flags. (The famous green play button)

To run the application, use Maven from the command line as described in [Quick Start](https://vaadin.com/docs/v25/tools/modernization-toolkit/swing-bridge/quick-start-guide.md) (skeleton starter) or [Installation from Scratch](https://vaadin.com/docs/v25/tools/modernization-toolkit/swing-bridge/installation-from-scratch.md) (from-scratch project).

> **Note:** Hotswap Agent and Spring Boot DevTools automatic restart are not fully supported with SwingBridge yet. If you detect unexpected behavior, try running the application without them.

## <a id="swing-bridge.running-and-debugging.remote-debug"></a>Remote Debugging

After starting the application through Maven, you can debug it using remote debugging. The skeleton starter project already includes the necessary JVM argument for this. If you set up from scratch, add the following to the `<jvmArguments>` section in your `spring-boot-maven-plugin` configuration:

```
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005
```

For IDE-specific setup instructions, see [IntelliJ IDEA](#swing-bridge.running-and-debugging.intellij) and [VS Code](#swing-bridge.running-and-debugging.vscode) below.

## <a id="ide-remote-debug-configuration"></a>IDE Remote Debug Configuration

IntelliJ IDEA

To set up remote debugging in IntelliJ IDEA:

1. Open **Run** **›** **Edit Configurations…​**.

2. Click the **+** button and select **Remote JVM Debug**.

3. Set the **Name** to something descriptive, such as `SwingBridge Remote Debug`.

4. Ensure **Debugger mode** is set to **Attach to remote JVM**.

5. Set **Host** to `localhost` and **Port** to `5005`.

6. Click **OK** to save the configuration.

Start the application through Maven first, then launch this debug configuration. The debugger attaches to the running application, and you can set breakpoints and step through code as usual.

VS Code

To set up remote debugging in VS Code:

1. Open or create the `.vscode/launch.json` file in your project.

2. Add the following configuration:

   ```json
   {
     "type": "java",
     "name": "SwingBridge Remote Debug",
     "request": "attach",
     "hostName": "localhost",
     "port": 5005
   }
   ```

3. Start the application through Maven first.

4. Open the **Run and Debug** view and select **SwingBridge Remote Debug**.

5. Click the green play button to attach the debugger.

You can now set breakpoints and debug the running application.
