debugging VS代码调试未在断点处停止

szqfcxe2  于 2023-06-23  发布在  其他
关注(0)|答案(1)|浏览(111)

我刚开始使用VS Code,因为我一直在使用Eclipse IDE。我正在尝试调试创建了断点的java文件,但是调试器只是运行代码,就好像没有断点一样。
我见过其他一些人在这方面挣扎,所以这是我的启动。json:

{
    // 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": [
        {
            "name": "Java",
            "type": "java",
            "request": "launch",
            "stopOnEntry": true,
            "jdkPath": "${env:JAVA_HOME}/bin",
            "cwd": "${fileDirname}",
            "startupClass": "${fileBasenameNoExtension}",
            "classpath": [
                ".",
                "${fileDirname}"
            ]
        },
        {
            "name": "Java Console App",
            "type": "java",
            "request": "launch",
            "stopOnEntry": true,
            "jdkPath": "${env:JAVA_HOME}/bin",
            "cwd": "${fileDirname}",
            "startupClass": "${fileBasenameNoExtension}",
            "classpath": [
                ".",
                "${fileDirname}"
            ],
            "externalConsole": true
        },
        {
            "type": "java",
            "name": "Current File",
            "request": "launch",
            "mainClass": "${file}"
        },
        {
            "type": "java",
            "name": "Numeros",
            "request": "launch",
            "mainClass": "Numeros",
            "projectName": "progra_4bad0bd0"
        }
    ]
}

我试过使用其他jdk(现在我使用Oracle),但它不工作

cidc1ykv

cidc1ykv1#

您需要使用绿色按钮从Run and Debug面板开始调试,以便使用 * launch.json * 中的配置。您可以在下拉菜单的 * launch.json * 中选择调试配置。

您也可以使用Run --> Start Debugging开始调试。

相关问题