首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java相关 >

ANT 编译警告: 编码 UTF-8 的不可映射字符解决方法

2012-03-04 
ANT 编译警告: 编码 UTF-8 的不可映射字符已经加了target namecompile descriptioncompile source f

ANT 编译警告: 编码 UTF-8 的不可映射字符
已经加了
<target name="compile" description="compile source files" depends="init">
<echo message="compile source files" />
<javac srcdir="${src.dir}" destdir="${build.classes}" debug="yes">  
<compilerarg line="-encoding UTF-8 "/> 
<classpath refid="classpath" />
</javac>
</target>

仍然报错,请大神们指导,谢谢

[解决办法]
这个警告说明你的源代码不是UTF-8编码,但是操作环境是UTF-8。

<compilerarg line="-encoding UTF-8 "/>
把里面的UTF-8改成代码的实际编码。

热点排行