编译错误失败,而不是在运行时抛出“未解决的编译问题”

时间:2020-10-18 22:33:49

标签: java visual-studio-code compiler-errors runtime-error

在编译包含错误的Java代码时,Visual Studio Code会生成字节代码抛出:

java.lang.Error: Unresolved compilation problem

如何禁用此设置?我希望Visual Studio Code不会为包含编译错误的类生成任何字节代码。

供参考:the graphical (GUI) shell that provides the Windows desktop and File Explorer

1 个答案:

答案 0 :(得分:1)

当您运行的项目出现sytax错误(一种编译错误)时,它将首先显示为问题:

enter image description here

然后您可以更正错误,或选择单击Proceed继续,编译错误将显示在终端中:

enter image description here

因此它确实是由编译时间或运行时间分隔的。 如果您的问题有误解,请告诉我。