Showing posts with label ant compile javac option. Show all posts
Showing posts with label ant compile javac option. Show all posts

Tuesday, November 16, 2010

Compile options in Ant javac task

Recently I was tasked to migrate a code base from JDK 1.4 to 1.6. As part of this work, I need to take care of deprecated methods and unchecked types in collections. To verify, I turned on the options in ANT javac task as below. Note the use of deprecation="on" and <compilerarg value="-Xlint:unchecked"/>.

        <javac destdir="${build.dir}" source="1.6" target="1.6" debug="true"
deprecation="on" failonerror="true">
<src path="${src.dir}"/>
<classpath refid="master-classpath"/>
<compilerarg value="-Xlint:unchecked"/>
</javac>