Docs

Running and Debugging

Run SwingBridge applications from Maven and attach a remote debugger from IntelliJ IDEA or VS Code.

Running from the Command Line

SwingBridge requires special JVM flags to access internal Java modules. Because of this, running the application by clicking the green play button in IntelliJ IDEA or the equivalent in VS Code is not supported at this time.

To run the application, use Maven from the command line as described in Getting Started (skeleton starter) or Installation (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.

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:

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

For IDE-specific setup instructions, see IntelliJ IDEA and VS Code below.

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:

    Source code
    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.

Updated