microsoft / microsoft/vscode-java-debug

Breakpoints don’t bind when attaching to JVM in WSL2 from Windows (Cursor/VS Code) — requests hang, `jdb` hits fine

Open
#1,582 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ai-triaged
Dominant language
TypeScript
Stars
591
Forks
429
Avg merge
1d 9h
Merged PRs (30d)
19

Description

Environment

  • Host OS: Windows 11
  • IDE: Cursor/VS Code on Windows with repo mounted via WSL2
  • Guest OS: WSL2 Ubuntu 22.04
  • Java: OpenJDK 1.8.0_432 (Java 8)
  • Extensions:
    • Debugger for Java: latest version
    • Language Support for Java™ by Red Hat: 1.47.0
  • Project: Spring Boot API (Gradle)

Expected behavior
Attach to 127.0.0.1:5005 and stop at breakpoints in controllers; HTTP requests hang until continued.

Actual behavior
Attach connects but IDE never stops at breakpoints; HTTP requests hang. Attaching with jdb hits breakpoints fine, so JDWP works. Rolling back both extensions fixes it.

Steps to reproduce

  1. Build: ./gradlew clean assemble -x test
  2. Run jar with JDWP:
    java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 \
         -Dspring.profiles.active=local -Duser.timezone=UTC \
         -jar build/libs/*.jar
    
  3. In Windows Cursor/VS Code, attach to host 127.0.0.1 port 5005.
  4. Set breakpoint in a @RestController method.
  5. Call the endpoint.

More info

  • javap -v shows SourceFile and LineNumberTable.
  • Verified JDWP by attaching via jdb -attach 127.0.0.1:5005; breakpoints hit.
  • Rolling back Debugger for Java (e.g., to 0.58.2) and Language Support for Java (e.g., to 1.46.0) resolves the problem.

Workaround
Roll back both Java extensions or use jdb.

Notes
Seems specific to Windows host + WSL2 remote debug mapping; not reproducible with native Windows debug.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the attach scenario with Windows 11, WSL2 Ubuntu, Java 8, and the listed extension versions using the provided Gradle and JDWP commands. Compare IDE behavior with jdb -attach 127.0.0.1:5005 and the noted extension rollbacks; done means controller breakpoints bind and HTTP requests resume correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript, vscode
Domain
devtools
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.