使用Ant Build時提示錯誤: 編碼GBK的不可映射字符


這個build.xml是由eclipse neon 2016.6生成的

我的情況是,所有文件都使用了UTF-8編碼,build.xml第一行也好好寫着UTF-8,但build時仍然有亂碼,並且提示失敗。

解決方法:打開build.xml,搜索"javac"

<javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false" source="${source}" target="${target}">

加上   encoding="UTF-8"

變成

<javac encoding="UTF-8" debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false" source="${source}" target="${target}">

問題解決。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM