1、設置工做空間全局編碼windows
【windows】>【Preferences】,打開【首選項】對話框,左側導航樹,導航到【general】>【Workspace】,右側【Text file encoding】,選擇【Other】,改變爲UTF-8,之後新創建工程其屬性對話框中的Text file encoding即爲UTF-8。編碼
2、設置文件默認編碼spa
Window -> Preferences -> General -> Content Types,將全部類型的編碼都改爲UTF-8。以下圖所示:code
3、設置特定文件編碼ip
【window】>【preference】>【MyEclipse】>【Files and Editors】,將每一個子項的"Encoding"改成"ISO 10645/Unicode(UTF-8)",點Apply!以下圖所示:it
通過以上3步,新建Java文件即爲UTF-8編碼。cli