解决Mac OS X - eclipse无法打开中文文件夹的文件和乱码
1 修改eclipse.app/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>
2、修改eclipse.app/Contents/MacOS/eclipse.ini,添加 -Dfile.encoding=UTF-8
3、关闭eclipse,重新启动。
4、如果不生效,打开终端,执行如下命令行,此为关键步骤
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -v -f /Applications/eclipse/eclipse.app
5、如果不生效,将/Applications/eclipse改名为其它名字,再次启动
1 修改eclipse.app/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>
2、修改eclipse.app/Contents/MacOS/eclipse.ini,添加 -Dfile.encoding=UTF-8
3、关闭eclipse,重新启动。
4、如果不生效,打开终端,执行如下命令行,此为关键步骤
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -v -f /Applications/eclipse/eclipse.app
5、如果不生效,将/Applications/eclipse改名为其它名字,再次启动