Skip to content

Title: java.debug.plugin version 0.46.0 in install/pom.xml is incompatible with JDK 22+ #507

@my0811

Description

@my0811

Description

The install/pom.xml pins com.microsoft.java.debug.plugin to version 0.46.0, which
passes the -Xnoagent JVM argument when launching debug sessions. This argument was
deprecated in JDK 22 and has been fully removed in later versions (e.g., JDK 25),
causing the JVM to fail to start during debugging.

Error

Java HotSpot(TM) 64-Bit Server VM warning: Option -Xdebug was deprecated in JDK 22
and will likely be removed in a future release.
Unrecognized option: -Xnoagent
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Steps to Reproduce

  1. Use lsp-java with the auto-downloaded jdtls (via lsp-java-update-server or first
    launch)
  2. Set lsp-java-java-path to JDK 22 or later (e.g., JDK 25)
  3. Open a Java file with a main method
  4. Run M-x dap-java-debug
  5. The debug session fails with the error above

Root Cause

In https://github.com/emacs-lsp/lsp-java/blob/master/install/pom.xml, the debug
plugin version is pinned to 0.46.0:

com.microsoft.java.debug.plugin
0.46.0

This version (from 2023) passes deprecated/removed JVM flags (-Xnoagent) that are
no longer recognized by JDK 22+.

Note: The jdtls server itself is downloaded as the latest version (which requires
JDK 21+), but the bundled debug plugin is too old to work with these newer JDK
versions. This creates a version mismatch.

Suggested Fix

Update install/pom.xml to use a newer version of com.microsoft.java.debug.plugin.
The latest version on Maven Central is 0.53.1. Similarly, vscode-java-test is
pinned to 0.28.0 (from 2020) and could also benefit from an update.

Environment

  • Emacs 30.2
  • Doom Emacs (latest)
  • lsp-java (pinned at 0a9f4d0)
  • JDK 25
  • OS: Arch Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions