Skip to content
Alexandre Henrique Afonso Campos edited this page Mar 22, 2020 · 3 revisions

Debugging a running server with an IDE can be tricky. First, you need to run

./gradlew :webscrambles:runShadow --debug-jvm

There will be a message like Listening for transport dt_socket at address: 5005. You will need the 5005.

Debugging with VSCode

  • Install a Kotlin extension File/Preferences/Extensions with debugging support.
  • Go to Debug/Add Configuration... and select Kotlin.
  • Replace (or adapt) the content of launch.json with
{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "java",
            "name": "Debug (Launch) - Current File",
            "request": "attach",
            "hostName": "localhost",
            "port": 5005
        }
    ]
}

Replace the "port" property if necessary.

Debugging with IntelliJ IDEA

Go to Run/Attach to Process... and select the java process with the same port you got after running ./gradlew :webscrambles:runShadow --debug-jvm.