Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 -Xlint:unchecked?

like image 700
Dave Fisher Avatar asked Nov 21 '11 17:11

Dave Fisher


1 Answers

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"/>   </javac>  

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

<compilerArgument>-Xlint:unchecked</compilerArgument> 
like image 131
sudocode Avatar answered Oct 14 '22 00:10

sudocode