JAVA环境变量不能映射字符,蚂蚁:警告:编码UTF8不可映射字符

I have seen numerous of questions like mine but they don't answer my question because I'm using ant and I'm not using eclipse. I run this code: ant clean dist and it tells me numerous times that warning: unmappable character for encoding UTF8.

I see on the Java command that there is a -encoding option, but that doesn't help me cuz I'm using the ant.

I'm on Linux and I'm trying to run the developer version of Sentrick; I haven't made no modifications to anything, I just downloaded it and followed all their instructions and it ain't makes no difference. I emailed the developper and they told me it was this problem but I suspect that it is actually something that gotta do with this error at the end:

BUILD FAILED

/home/daniel/sentricksrc/sentrick/build.xml:22: The following error occurred while executing this line:

/home/daniel/sentricksrc/sentrick/ant/common-targets.xml:83: Test de.denkselbst.sentrick.tokeniser.components.DetectedAbbreviationAnnotatorTest failed

I'm not sure what I'm gonna do now because I really need for it to work

解决方案

Try to change file encoding of your source files and set the Default Java File Encoding to UTF-8 also.

For Ant:

add -Dfile.encoding=UTF8 to your ANT_OPTS environment variable

Setting the Default Java File Encoding to UTF-8:

export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8

Or you can start up java with an argument -Dfile.encoding=UTF8

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值