0

I'm getting the classic

Foo.java: Some input files use unchecked or unsafe operations.
Foo.java: Recompile with -Xlint:unchecked for details.

Okay fine, it's the old story about some expression using generics in a way that is not quite to javac's liking, should be easy enough to fix once I see which line it doesn't like.

Problem: I'm not running javac directly, I'm running Maven, which doesn't take -Xlint:unchecked. And Intellij, which normally has a surprisingly keen eye for potential problems in the code, sees nothing even slightly objectionable in Foo.java.

What's the simplest/idiomatic way to either tell Maven to say which line number the unchecked or unsafe operations are on, or to just tell it to ignore those things entirely?

rwallace
  • 31,405
  • 40
  • 123
  • 242
  • 1
    `-xLint` is a _Maven_, not Java, command. See the duplicate link for a number of options to use it. – Tim Biegeleisen Jul 08 '19 at 05:01
  • @TimBiegeleisen Really? I tried `mvn compile -Xlint:unchecked` before posting just to make sure, and it exited with an error 'no plugin found for prefix 'lint''. What I'm I missing? What duplicate link? – rwallace Jul 08 '19 at 05:05
  • 1
    Check the link at the top of your question, which was marked duplicate. This is a known problem, asked here before many times already. – Tim Biegeleisen Jul 08 '19 at 05:06
  • @TimBiegeleisen Ah, I see it now, thanks! – rwallace Jul 08 '19 at 05:14
  • Spend 20-30 minutes searching SO and Google before you post. If you really can't find anything, then your question probably merits being asked. – Tim Biegeleisen Jul 08 '19 at 05:16

0 Answers0