您的位置:首页 > 编程语言 > Java开发

在Ant的javac中指定源文件编码方式,以避免"警告: 编码 GBK 的不可映射字符"的错误

2012-03-22 02:49 309 查看
转载自: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 编译器 build
相关文章推荐