【发布时间】: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();
}
}
【问题讨论】:
-
检查你的 "args": [" "] 在 launch.json 文件中。通常,如果文件名为空或不同,则不会运行或运行不同的程序。
-
方便的话可以贴出整个代码吗?您发布的代码不足以让我重现您的问题。
标签: java debugging visual-studio-code vscode-debugger