Dave Fisher Dave Fisher - 1 year ago 201
Java Question

How do I compile with -Xlint:unchecked?

I'm getting a message when I compile my code:

Note: H:\Project2\MyGui2.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

How do I recompile with

Answer Source

Specify it on the command line for javac:

javac -Xlint:unchecked

Or if you are using Ant modify your javac target

  <javac ...>
    <compilerarg value="-Xlint"/>

If you are using Maven, configure this in the maven-compiler-plugin

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download