使用VS代码调试导入的文件 [英] Debug Imported Files in VS Code
本文介绍了使用VS代码调试导入的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我最近为VS Code设置了Java扩展.我有一个文件夹,其中包含两个文件 Main.java
和 Person.java
. Main.java
调用 Person.java
.当我在 Main.java
中设置一个断点时,一切正常,但是,当我在 Person.java
中设置一个断点时,它会跳过它.
I have recently set up the Java extension for VS Code.I have a folder that contains two files Main.java
and Person.java
. Main.java
calls Person.java
. When I set a breakpoint in Main.java
, everything works as normal.However, when I set a breakpoint in Person.java
, it just skips over it.
此问题是否有任何解决方法?
Are there any workarounds in this issue?
Main.java文件
Main.java file
public class Main {
public static void main(String[] args) {
System.out.println("Hello World!");
Person person = new Person();
person.speak();
}
}
Person.java文件
Person.java file
public class Person {
public void speak(){
System.out.println("Speak!");
//breakpoint on this line right here gets skipped
System.out.println("Speak!");
}
}
推荐答案
运行->开始调试,它在断点处停止:
Run -> Start Debugging, it stops at the breakpoint:
这篇关于使用VS代码调试导入的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文