转载自:http://blog.csdn.net/dusj/article/details/4956765
<target name="compile" depends="prepare">
<echo message="5.compile" />
<javac fork="true" target="1.6" srcdir="${src}" destdir="${build}" debug="true">
<!--给编译器指定编码,防止出现:"警告: 编码 GBK 的不可映射字符"-->
<compilerarg line="-encoding UTF-8 " />
<classpath refid="external.jars.path" />
</javac>
<echo message="compile finished!" />
</target>
本文介绍如何使用Ant构建Java项目,包括设置编译参数、指定编译源文件路径、目标文件路径及编译后的输出信息等。同时展示了如何通过<compilerarg>元素指定编码为UTF-8以避免编译过程中的字符集问题,并引入外部类路径。
480

被折叠的 条评论
为什么被折叠?



