【问题标题】:java debugger not working in visual sudio codejava调试器在Visual Studio代码中不起作用
【发布时间】:2021-02-20 12:46:47
【问题描述】:

我已经安装了调试器扩展 我创建了launch.json文件并在主函数中添加了断点但是当我点击运行时没有任何反应,当我点击调试时 它一直加载而没有响应我试图重新安装扩展 并重新启动vscode,但问题仍然存在 这是我添加断点的类:

import java.util.*;

public class CaeserCipher {
    int key;
    String message;

    public CaeserCipher(String plaintext, int secret) {
        message = plaintext;
        key = secret;
    }

    private String preprocess(String text) {
        return (text.toLowerCase()).replaceAll("\\s+", "");
    }

    protected String encrypt() {
        message = preprocess(message);
        int n = message.length();
        String cipherText = "";
        for (int i = 0; i < n; i++) {
            char temp = message.charAt(i);
            temp += key;
            if (temp > 'z')
                temp -= 26;
            cipherText += temp + "";
        }
        return cipherText;
    }

    public static void main(String args[]) {
        CaeserCipherDemo test = new CaeserCipherDemo();
        test.run();
    }
}

这是我运行调试时来自 vscode 的屏幕截图:

【问题讨论】:

  • 检查你的 "args": [" "] 在 launch.json 文件中。通常,如果文件名为空或不同,则不会运行或运行不同的程序。
  • 方便的话可以贴出整个代码吗?您发布的代码不足以让我重现您的问题。

标签: java debugging visual-studio-code vscode-debugger


【解决方案1】:

您必须将地区、数据和时间更改为英文格式。

【讨论】:

猜你喜欢
  • 2017-10-02
  • 1970-01-01
  • 1970-01-01
  • 2016-10-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-06-23
  • 1970-01-01
相关资源
最近更新 更多