【问题标题】:Fail on compile errors instead of throwing "Unresolved compilation problem" at run time编译错误失败,而不是在运行时抛出“未解决的编译问题”
【发布时间】:2020-10-18 22:33:49
【问题描述】:

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

java.lang.Error: Unresolved compilation problem

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

供参考:Eclipse IDE has the same default behavior

【问题讨论】:

  • 你的意思是禁用这个异常警告吗?
  • 我想得到一个编译时错误而不是运行时错误。

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


【解决方案1】:

当你运行一个有语法错误(一种编译错误)的项目时,它首先会显示为问题:

然后你可以修复错误,或者点击Proceed选择继续,编译错误会在终端显示:

所以它确实是由编译时间或运行时间分开的。 如果对您的问题有任何误解,请告诉我。

【讨论】:

    猜你喜欢
    • 2017-12-02
    • 1970-01-01
    • 1970-01-01
    • 2013-02-21
    • 2011-12-23
    • 1970-01-01
    • 2020-04-13
    • 1970-01-01
    相关资源
    最近更新 更多