Skip to content

Stopping a Java Application with the debugger Stop button dos not work #1705

Open

Description

@rbi

How to Reproduce

  • Just a normal Java Launch configuration e.g.
{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "java",
            "name": "MyApp",
            "request": "launch",
            "projectName": "application",
            "mainClass": "my.app.Application",
        },
  • Start the Configuration
  • Stop via the Debugger Stop Button

What happened

  • The application starts fine ...
  • ... but it doesn't stop. You have to terminate it manually by pressing CTRL+C in the terminal.

What should happen

  • Stopping via the Debugger controls should also terminate the Application at least when the launch configuration is started with "request": "launch".

Analysis
There was some analysis done by Rafael Derner (@rafael-derner) in the last comment of #1585 . This might help fix the bug. #1585 is about Gracefull shutdown not working properly. This bug is about no shutdown being attempt at all. Just killing the process like before would be better than no shutdown at all.

Activity

  1. issuelens commented on Sep 28, 2026

    @issuelens

    Thanks for the clear distinction: the JVM staying alive after Stop is a termination failure, not just shutdown hooks being skipped.

    The last comment on #1585 does describe the same visible symptom, specifically after upgrading from 0.58.5 to 0.59.0 in a Dev Container. That is a useful lead, but your versions and environment are still needed before treating these as the same underlying bug.

    The debug-server shutdown path is the likely area to investigate. The earlier change associated with #1585 detached the debugger before requesting termination. The current server handler instead requests termination before detaching. This does not establish that your installed extension contains that newer behavior or that it resolves your case.

    Could you share:

    • VS Code, Debugger for Java, Language Support for Java, and application JDK versions; OS; and whether this runs locally, in WSL, over SSH, or in a Dev Container.
    • A minimal reproducing application and the complete launch configuration, with sensitive values removed, including any console setting.
    • Whether the debug toolbar/session disappears after Stop while the original Java process remains alive, and whether Run Without Debugging stops correctly.

    For now, the terminal Ctrl+C workaround you identified is the practical way to stop the application.

  2. wenytang-ms commented on Oct 12, 2026

    @wenytang-ms
    Contributor

    Raik Bieniek (@rbi) Thanks for reporting this. We fixed a similar Stop regression in microsoft/java-debug#626. The fix is included in the pre-release builds of Debugger for Java, but not in stable version 0.59.0.

    Could you share which Debugger for Java version you were using, and try the latest pre-release, 0.59.2026092407? Open the extension's page in VS Code, select Switch to Pre-Release Version, then run Developer: Reload Window. If you use a Dev Container, WSL, or SSH, please update the extension in that remote environment.

    With the same launch configuration, does clicking Stop now terminate the Java application without needing Ctrl+C?

    If it still happens, please share your VS Code, Language Support for Java, and JDK versions, your OS/local or remote setup, and the complete launch configuration with sensitive values removed.

  3. rbi commented on Oct 12, 2026

    @rbi
    Author

    I have this issue with version 0.59.0 of the extension. I have now tried out the pre-release version 0.59.2026092407. With this version the stop button works again as expected. This issue should be solved with the next release version.

    Thanks for looking into it. 👍

  4. issuelens commented on Oct 12, 2026

    @issuelens

    Thanks for testing and confirming: Stop fails with 0.59.0, but works again with pre-release 0.59.2026092407 in your setup. That answers the version/test question and gives you a working option without needing Ctrl+C.

    You can continue using that pre-release for now. This confirms recovery in the tested pre-release, rather than a fix already available in a stable release. Once a stable version containing the fix is available, please switch back and verify Stop with the same launch configuration. No further environment details are needed unless the problem returns.

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