zhangsanfeng88 发表于 2016-1-3 01:04:36

Ant.OutputIsUnreadableCode

  Ant在Mac OS X终端中的输出乱码的问题
  1. 问题:
  在用Ant脚本进行构建Android App时,在编译失败时,Ant 输出有乱码。
  2. 环境:
  Mac OS X, 简体中文版。在Ternimal下允许shell脚本,脚本调用ant来进行构建。
  3. 问google后解决:
  编辑home目录下的 .bash_profile 文件,添加以下行 
  export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8
  然后保存该文件,然后运行
  $ source .bash_profile
  
  Reference
  1.
  http://wenson.iyunv.com/blog/2102892
  http://yang3wei.github.io/blog/2013/02/10/java-dfile-dot-encoding-equals-utf-8-gan-diao-luan-ma/
  2. JAVA_TOOL_OPTIONS
  http://docs.oracle.com/javase/7/docs/webnotes/tsg/TSG-VM/html/envvars.html#gbmsy
  关于JAVA_TOOL_OPTIONS的详细解释。
页: [1]
查看完整版本: Ant.OutputIsUnreadableCode