Ladys & Gentlemen:
1.打开eclipse安装目录,显示eclipse.app包内容
2.修改Contents/info.plist 文件,增加内容:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<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>
<key>CFBundleExecutable<key>
<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
4.执行/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -v -f /Applications/eclipse/eclipse.app
5、如果不生效,将/Applications/eclipse/eclipse.app改名为eclipse.app的绝对路径,再次启动(方法来源于:https://blog.csdn.net/dreajay/article/details/25796511)