How do you attach to a remote Java debugger using Visual Studio Code

Create a Debug Configuration like below and press F5 to debug :

"version": "0.2.0",
"configurations": [
    {
        "type": "java",
        "name": "Debug (Attach)",
        "projectName": "Your_Project_Name",
        "request": "attach",
        "hostName": "your_host_name",
        "port": Debugging_port
    }
]

Example :

"version": "0.2.0",
"configurations": [
    {
        "type": "java",
        "name": "Debug (Attach)",
        "projectName": "MyApplication",
        "request": "attach",
        "hostName": "localhost",
        "port": 8787
    }
]

I am using wildfly server. So the default debugging port is 8787.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)