1.
ant編譯到一般突然停止不報錯/編譯到javac時報錯--->build.xml->run as->External tools Configurations -> common -> dncofing ->other ->UTF-8
2.javac編譯失敗, 將<javac encoding=“”>改爲和你代碼相匹配的字節碼
3爲ANT進行輸出的時候,默認的情況下使用的是系統默認的字符集編碼,所以如果在英文操作系統,經常發生控制檯輸出亂碼的情況,使用下面的配置可以解決問題:
<sysproperty key="file.encoding" value="UTF-8" />
<javac srcdir="${project.src}" destdir="${project.output.build}" debug="on" encoding="UTF-8" deprecation="on" listfiles="on" includeAntRuntime="no">
<compilerarg value="-Xlint:all" />
<classpath refid="project.classpath" />
<classpath refid="tomcat.classpath" />
</javac>
<java classpathref="project.classpath" classname="com.mose.ParserEnglish" fork="true" failonerror="true">
<sysproperty key="file.encoding" value="UTF-8" />
<arg value="-h" />
</java>