Skip to content

attach by processId fails on windows due to removed wmic.exe #1721

Open

Description

Version: Debugger for Java 0.60.0

With the August 2026 update wmic.exe was finally removed from Windows after being deprecated for some years. src/processTree.ts still uses wmic.exe to fetch the process list.

Attaching to a running Java process either by picking a process or by processId now fails.

An alternative is this powershell script:
Get-CimInstance Win32_Process | ForEach-Object { "$($_.CommandLine) $($_.ParentProcessId) $($_.ProcessId)" }

Activity

  1. issuelens commented on Oct 26, 2026

    @issuelens

    Thanks for the clear report. The current Windows path in src/processTree.ts still launches System32\wbem\WMIC.exe to enumerate processes, so systems where WMIC has been removed cannot build the process tree used by process-picker and processId attachment. This confirms the failure is in the extension-side Windows process enumeration rather than the debug server or target JVM. We did not find an existing issue with matching technical details across the configured Java-tooling repositories. The suggested Get-CimInstance Win32_Process approach is useful input for the maintainer investigation.

  2. wenytang-ms commented on Oct 28, 2026

    @wenytang-ms
    Contributor

    Thanks for reporting this. As a workaround, please attach directly to the JVM’s debug port instead of using processId or the process picker. This avoids the dependency on WMIC.

    Add this configuration to .vscode/launch.json, replacing 5005 with your JVM’s actual JDWP port:

    {
        "version": "0.2.0",
        "configurations": [
            {
                "type": "java",
                "name": "Attach to Java (port 5005)",
                "request": "attach",
                "hostName": "127.0.0.1",
                "port": 5005
            }
        ]
    }

    The target JVM must have JDWP enabled. Please let us know whether this works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions