In fact, all the Chinese garbled problem is caused by different coding. In order for Eclipse to display the kanji correctly, it is necessary to modify its character encoding
The steps are as follows:
1, click Window in the menu bar, select Preferences (preferences)
2. In the window that comes out, select General (Normal) on the left. and pull it out of the menu
3, in the Select Content Types option, which will see text on the right, click the dropdown menu
4, select the Java Source File, and then set the bottom defaultencoding to GBK (seemingly GB18030 and GB2312 also line), click on the right of the update, and then click OK.
5, restart Eclipse (at that time because I do not know the need to restart, trapped me for several hours), do not restart the words can not be saved.
If the project name in the workspace on the left side of the Eclipse editing page is garbled, it's the same way, just choose the option below text.
Font modification: The first two steps are the same,
3, select Appearance->color and Fonts,
4, this is to look to the right, you will see a box, click on the first basic, then drop down options to select Textfont, click on the right edit option to set the font and background color
Solve the Java code written by eclipse in Ubuntu to open windows in English garbled