java - warning during javac compilation by ant -
i have ant build java application. i'm forced make application java 1.6 compatible.
when run ant script following warning:
[javac] warning: [options] bootstrap class path not set in conjunction -source 1.6 can explain me mean , should remove it? code works fine, i'm going put in production , don't leave kind of warnings unresolved.
my build.xml file looks this:
<path id="master-classpath"> <fileset dir="lib"> <include name="*.jar"/> </fileset> </path> <target name="compile" depends="clean"> <javac srcdir="src" destdir="${bin-dir}" debug="on" source="1.6" includeantruntime="false"> <classpath refid="master-classpath"/> </javac> </target> <target name="clean"> <mkdir dir="${bin-dir}"/> <mkdir dir="${build-dir}"/> <delete> <fileset dir="${bin-dir}"/> <fileset dir="${build-dir}"/> </delete> </target> ant version: ant(tm) version 1.8.2
java version: javac 1.7.0_79
this means although using -source option, still have jdk 1.7 library, javac cannot guarantee code work on java 1.6. javac check whether not using new syntactic features (like try-with-resources operator), cannot check whether using new api methods (like java.nio.file.files class). if it's compiled correctly, may not work.
to opinion best solution compile jdk 1.6. warning suggests provide custom bootstrap class path points on installed jre 1.6. can follow advice if have jre 1.6, don't want run whole build on jdk 1.6.
Comments
Post a Comment