Skip to content

Java Remote Debugging

Debugging

To connect for remote java debugging of Eclipse Dirigible, follow the next steps:

  1. Start the Dirigible executable JAR with the JDWP agent enabled. The runtime ships as a self-contained Spring Boot fat JAR (dirigible-application-*-executable.jar under build/application/target/), so the standard -agentlib:jdwp=... JVM flag is all that is needed:

    Start Dirigible with the JDWP agent

    java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000 \
      -jar build/application/target/dirigible-application-*-executable.jar
    
    java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000 `
      -jar build/application/target/$((Get-ChildItem dirigible-application-*-executable.jar -recurse -File | Sort-Object LastWriteTime | Select -Last 1).BaseName).jar
    

    Run the docker image with Java Debugging Options as described here.

    The JVM will listen for debugger attaches on port 8000 (configurable via the address= part of the agent string). Use suspend=y instead of suspend=n if you need the JVM to wait for the debugger before continuing startup.

  1. Create new Debug Configuration:

    New Debug Configuration Project

  2. New Remote Java Application configuration:

    Note

    • Double click on the Remote Java Application to create new configuration.
    • Update the host and port properties, if needed.

    Remote Java Application Configuration

  3. Press the Debug button to start new remote debug session.

  1. Create new Debug Configuration from the Edit Configurations.. option:

    remote_debug_intellij

  2. Add new Remote JVM Debug configuration using the + button and double click on Remote JVM Debug:

    new_remote_jvm_debug_configuration

  3. Use the configuration provided on the screenshot below, update the host and port properties if needed:

    remote_debug_configuration

  4. Press the Debug button to start new remote debug session.