IntelliJ says "Warning: java: foo/bar/Baz.java uses unchecked or unsafe operations", but it doesn't say in which line it is referring to

To compile with -Xlint:unchecked in IntelliJ IDEA:

  • Go to Settings dialog (Ctrl+Alt+S or +, )
  • Select Compiler > Java Compiler
  • Add following into the field Additional command line parameters:

    -Xlint:unchecked

  • Run your compile again


IntelliJ IDEA 15

A faster solution:

  • Press Ctrl + Shift + A
  • Type "Additional com" and press Enter:

    Additional command line parameters

  • Type -Xlint:unchecked > OK

    Xlint unchecked

  • Press Ctrl + Shift + F9 to recompile (or go to Build > Compile ... )

    • you can select a class / module from the project tree to specify what you want to be recompiled
  • You will see the line and the column where the problem appeared

    E.g.: Warning:(5,27) java: unchecked ...


I'm not sure why your IDE does not show you generic warnings, but you can try to compile with

-Xlint:unchecked

to get more details.