Vscode debug Java console input: evaluation failed because the thread is not suspended

use VS Code to debug Java program, need to use the console input, the results have been error, find a solution


add a line "console": "externalTerminal" for

    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
            "type": "java",
            "name": "Debug (Launch)-main<test>",
            "request": "launch",
            "mainClass": "main.main",
            "projectName": "test",
            "console": "externalTerminal"

works as follows:

this error occurs because the built-in debugging console of VSCode does not support Java input. So you need to modify the debug console in the Debug configuration file, just change the console property to externalTerminal. External terminal.

Read More: