1.打开eclipse安装目录,显示eclipse.app包内容
2.修改Contents/info.plist 文件,增加内容:
LSEnvironment
<dict>
<key>JAVA_TOOL_OPTIONS</key>
<string>-Dfile.encoding=UTF-8</string>
<key>LANG</key>
<string>zh_CN.UTF-8</string>
</dict>
//此处是默认文件的开始,加上面一段xml即可。
CFBundleExecutable
eclipse
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