eclipse-jdt / eclipse-jdt/eclipse.jdt.debug
SocketLaunchingConnectorImpl#launch emits legacy JPDA flags on modern JDKs
- Dominant language
- Java
- Stars
- 23
- Forks
- 68
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 13
Description
`SocketLaunchingConnectorImpl#launch` currently constructs the debuggee command line by unconditionally adding the legacy JPDA launch sequence:
// SocketLaunchingConnectorImpl.java:204-205
execString += " -Xdebug -Xnoagent -Djava.compiler=NONE";
execString += " -Xrunjdwp:transport=dt_socket,address=" + address
+ ",server=n,suspend=" + (fSuspend ? "y" : "n");
On JDK 21, this produces the following warning on every debugger launch:
OpenJDK 64-Bit Server VM warning: The java.compiler system property
is obsolete and no longer supported, use -Xint
On JDK 23, the situation is worse: `-Xnoagent` is no longer recognized
and the debuggee fails to start outright with `Unrecognized option:
-Xnoagent`. The standard JDI launching connector therefore does not
work on a current JDK.
For JDK 5 and later, the supported debug-agent form is:
-agentlib:jdwp=transport=dt_socket,address=...,server=n,suspend=...
The other options are not needed for modern debugging:
1. `-Xdebug` is a compatibility option that has been ignored on modern
JDKs and was deprecated for removal in JDK 22.
2. `-Xnoagent` has been ignored for many releases, was deprecated for
removal in JDK 22, and is rejected outright in JDK 23.
3. `-Djava.compiler=NONE` is obsolete on JDK 13+, emits the warning
above, and no longer selects interpreted-only execution. If
interpreted-only execution is desired, the supported option is
`-Xint`.
- The sibling launcher path `StandardVMDebugger#runVMArguments`
(org.eclipse.jdt.launching/.../StandardVMDebugger.java:196-214)
already gates the legacy options by Java version and prefers
`-agentlib:jdwp=...` for Java 5 and later.
- The PR #511 in this repo fixed the same warning by JDK-gating the legacy emit, but only in the JDI test infrastructure
(`org.eclipse.jdt.debug.jdi.tests/.../AbstractJDITest.java`).
`SocketLaunchingConnectorImpl#launch` was not updated.
- microsoft/java-debug#561 → #562: Microsoft's parallel launcher path
hit the same JDK 23 breakage and patched it.
Suggested fix: replace lines 204-205 with
execString += " -agentlib:jdwp=transport=dt_socket,address=" + address
+ ",server=n,suspend=" + (fSuspend ? "y" : "n");
`-agentlib:jdwp=` has been supported since JDK 5, so no version gating
is required. Alternatively, mirror `StandardVMDebugger` by detecting
the target JDK version and gating the
legacy emit accordingly.
Reproduction
------------
- Editor: Emacs 30.x with dap-mode + lsp-java; JDT LS server bundle
`org.eclipse.jdt.debug 3.25.100.v20260212-0641`,
`jdimodel.jar` from bundle `org.eclipse.jdt.debug.jdi`.
- Target JDK tested: Eclipse Temurin 21.0.11 (reproduces the warning).
JDK 23 hard-failure mode is documented via [JDK-8312072](https://bugs.openjdk.org/browse/JDK-8312072) not re-reproduced here.
- Action: M-x dap-java-debug on a trivial Maven project with a public
static void main(String[]).
Captured debuggee command line:
java -Xdebug -Xnoagent -Djava.compiler=NONE \
-Xrunjdwp:transport=dt_socket,address=localhost:,server=n,suspend=y \
-cp
Contributor guide
Assessment
This issue has not been assessed yet.