Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to recompile with -Xlint:unchecked in Ant build task?

When I run the "compile" target of my Ant "build.xml" file, then I get the following message:

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

My compile target is the following:

  <target name="compile">     <javac srcdir="${src.dir}" destdir="${classes.dir}" debug="true" debuglevel="lines,source" includeantruntime="false">       <classpath refid="class.path" />     </javac>     <javac srcdir="${test.dir}" destdir="${classes.dir}" debug="true" debuglevel="lines,source" includeantruntime="false">       <classpath refid="class.path" />     </javac>   </target> 

What do I have to change in my build.xml file so that -Xlint:unchecked is done there?

like image 822
Benny Neugebauer Avatar asked Jan 04 '11 20:01

Benny Neugebauer


People also ask

How do I build an Ant build xml?

Create Ant build file In the Project tool window, select the directory, where the build file should be created. Right-click the directory and from the context menu, select New | File ( Alt+Insert ). In the New File dialog, specify the name of the new file with the xml extension, for example, build. xml.

What does * stand for in * Test Java?

**\*.sql means "in the given directory and inside all of its subdirectories, all the files that end with .sql"

What is includeAntRuntime in Ant?

includeAntRuntime. Whether to include the Ant run-time libraries in the classpath. It is usually best to set this to false so the script's behavior is not sensitive to the environment in which it is run. No; defaults to yes , unless build.sysclasspath property is set.


1 Answers

Add the following element in <javac></javac> section:

<compilerarg value="-Xlint:unchecked" /> 
like image 162
Lukasz Avatar answered Oct 10 '22 01:10

Lukasz