【问题标题】:Ant Build failed in eclipse, but from command prompt it is successfull [closed]Ant Build在eclipse中失败,但从命令提示符成功[关闭]
【发布时间】:2013-08-14 10:27:20
【问题描述】:

我收到以下错误:

错误:用于编码 UTF8 的不可映射字符 [javac] // url 编码为 '�' 将得到正确的 url 编码。

【问题讨论】:

    标签: java eclipse ant


    【解决方案1】:

    修改ant添加这个

    <?xml version="1.0" encoding="utf-8" ?>
    <project name="test" default="compile">
        <target name="compile">
            <javac srcdir="src" destdir="classes" 
                               encoding="cp1252" debug="true" />
        </target>
    </project>
    

    阅读本文了解更多详情:http://www.weblogism.com/item/288/unmappable-character-for-encoding-utf8

    【讨论】:

    • 感谢您的回复。实际上它是一个只读文件。我无法编辑文件
    • 哦,然后尝试将java.encoding=utf-8 添加到您的 build.properties 文件中。
    • 等等,这是 Java 还是 Android?对于 Java 源文件,请查看:stackoverflow.com/questions/1339352/…
    • 谢谢,它现在可以正常工作而无需更改任何内容。在 build.properties 文件中 java.encoding=utf-8 已经存在。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-04-19
    • 2018-03-02
    • 2018-07-18
    • 2012-11-04
    • 1970-01-01
    • 2020-01-24
    相关资源
    最近更新 更多