1.打開eclipse安裝目錄,顯示eclipse.app包內容
2.修改Contents/info.plist 文件,增加內容:
<dict>
<key>LSEnvironment</key>
<dict>
<key>JAVA_TOOL_OPTIONS</key>
<string>-Dfile.encoding=UTF-8</string>
<key>LANG</key>
<string>zh_CN.UTF-8</string>
</dict>
//此處是默認文件的開始,加上面一段xml即可。
<key>CFBundleExecutable</key>
<string>eclipse</string>
3.修改Contents/MacOS/eclipse.ini文件
在末尾加上 -Dfile.encoding=UTF-8
重啓eclipse即可(此處作者已經ok,沒有執行第4步)。
4.如果沒有生效執行/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -v -f /Applications/eclipse/eclipse.app
5、如果不生效,將/Applications/eclipse改名爲其它名字,再次啓動(方法來源於:http://qing.blog.sina.com.cn/tj/62de843e33002hwz.html)