
Solution:
1. Find in the menu bar above: Window --> Preferences

##2. Next, expand in order: General --> Workspace. You can see that the default encoding is GBK format

3. If you want to support Chinese, you need utf -8 encoding format. So here we change the encoding to utf-8, click: Other, select "UTF-8", and then click "Apply and Close"

4. You can see it at this time The Chinese language has been displayed normally, and it can also run successfully

Recommended tutorial:
java tutorial
The above is the detailed content of How to solve garbled code in java eclipse. For more information, please follow other related articles on the PHP Chinese website!
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn