I use ant 1.9.4 and jdk1.8,my build.xml file is follows:
<?xml version="1.0" encoding="UTF-8" ?> <project name="demo" default="run" basedir="."> <property name="src" value="src"/> <property name="lib" value="src/lib"/> <property name="dest" value="WEB-INF/classes"/> <property name="dest_lib" value="WEB-INF"/> <path id="Third-Part Lib"> <fileset dir="${lib}"> <include name="*.jar" /> </fileset> </path> <target name="init"> <mkdir dir="${dest}"/> </target> <target name="compile" depends="init"> <javac srcdir="${src}" destdir="${dest}"> <classpath refid="Third-Part Lib"/> </javac> </target> <target name="build" depends="compile"> <mkdir dir="${dest}"/> <javac srcdir="${src}" destdir="${dest}" target="1.8" debug="true" deprecation="true" optimize="false" failonerror="true" includeantruntime="false"><compilerarg value="-Xlint:unchecked"/></javac> <copy todir="${dest}" preservelastmodified="true"> </copy> </target> <target name="run" depends="build"> <java classname="demo.StudentTest"> <classpath refid="Third-Part Lib"/> </java> </target> <target name="clean"> <delete dir="${dest}" /> </target> <target name="rerun" depends="clean,run"> <ant target="clean" /> <ant target="run" /> </target> </project> when I use ant build to compile java file,it raise following warning message: compile: [javac] E:\tomcat\webapps\demo\build.xml:17: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds [javac] Compiling 13 source files to E:\phoenix\webapps\phoenix\WEB-INF\classes [javac] Waring: E:\tomcat\webapps\demo\src\demo\StudentTest.java using or overwrite old API [javac] Waring: For detail information, Please use -Xlint:deprecation to compile I have used <compilerarg value="-Xlint:unchecked"/> in <javac>, why ant still raise above information? How can I get which API is old? I am puzzled it for several days. How to make -Xlint:deprecation to work? PS: How to set 'includeantruntim'? Thanks.