1

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?

Denise
  • 898
  • 1
  • 16
  • 30

1 Answers1

3

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.

JustAnotherDeveloper
  • 2,061
  • 2
  • 10
  • 24
  • Why does this error show only for some warnings and not others ? – Denise Aug 22 '20 at 11:30
  • That I do not know. At least not without knowing what warnings are not being treated as errors by the flag in your case. – JustAnotherDeveloper Aug 22 '20 at 11:38
  • I faced a similar issue, I searched the word '-Werror' in my project and found it in build.sbt under javaOptions. After commenting it is working fine. Thanks @JustAnotherDeveloper. – Kishor K Jun 05 '21 at 19:01
  • Here one can read the exactly maven properties (and their values) that would cause this error to happen. https://stackoverflow.com/a/33823355/7066647 – dbaltor Jul 07 '22 at 16:34