Ant.OutputIsUnreadableCode

Ant在Mac OS X終端中的輸出亂碼的問題html

1. 問題:java

在用Ant腳本進行構建Android App時,在編譯失敗時,Ant 輸出有亂碼。git

2. 環境:github

  Mac OS X, 簡體中文版。在Ternimal下容許shell腳本,腳本調用ant來進行構建。web

3. 問google後解決:shell

  編輯home目錄下的 .bash_profile 文件,添加如下行 bash

  export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8oracle

  而後保存該文件,而後運行google

  $ source .bash_profilelua

 

Reference

1. 

http://wenson.iteye.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的詳細解釋。

相關文章
相關標籤/搜索
本站公眾號
   歡迎關注本站公眾號,獲取更多信息