如何解决/禁用 Java 项目中的-Werrors警告?

huangapple go评论71阅读模式
英文:

How to resolve/disable -Werrors in java projects?

问题

在我的Java maven项目中,当我尝试在IntelliJ中编译项目时,它会出现以下错误:

错误:发现java警告,并且指定了-Werror

我发现,-Werror 是因为警告被视为错误而引起的。有没有办法禁用这个功能呢?

英文:

In my Java maven project, when I try compiling the project in IntelliJ , it gives the error

Error: java warnings found and -Werror specified

I have found that -Werrors are caused due to warnings being shown as errors. Is there a way to disable this?

答案1

得分: 3

你正在使用-Werror标志构建你的项目。该标志将警告视为错误,因此会导致构建失败。你可以从构建选项中删除该标志,或者解决这些警告。

英文:

You are building your project with the -Werror flag. That flag treats warnings as errors and therefore makes the build fail. You can either remove the flag from your build options or solve the warnings.

huangapple
  • 本文由 发表于 2020年8月22日 19:14:45
  • 转载请务必保留本文链接:https://go.coder-hub.com/63535509.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定