ANT控制台输出中文乱码的解决方法

来源:互联网 发布:adb安装软件命令 编辑:程序博客网 时间:2024/04/27 14:53

ant运行java

    <target name="run" depends="compile">    <java fork="true" failonerror="true" jar="${jar_path}"><sysproperty key="file.encoding" value="UTF-8" /><!--<arg value="${args[0]}" />--></java></target>

ant运行junit

    <target name="run" depends="compile"><junit printsummary="on" fork="true" showoutput="true"><sysproperty key="file.encoding" value="UTF-8" /> <classpath><fileset dir="${lib.dir}" includes="**/*.jar" /><pathelement path="${classes}" /></classpath><formatter type="xml" usefile="true"/><batchtest todir="${report}/${time}"><fileset dir="${classes}"><include name="com/testcase/runner/*.*" /></fileset></batchtest></junit></target>


关键行:

<sysproperty key="file.encoding" value="UTF-8" />


0 0
原创粉丝点击