Open the Java file in eclipse, and the comments are garbled!

Source: Internet
Author: User

Import the project for development today. After opening the project, the comments of the Java source file become garbled, so I started searching on Google and got the conclusion:

Cause: Because the default encoding in Windows is GBK, and my java source file encoding is UTF-8, so the comment in windows, under myelipse view becomes garbled.

The solution is as follows:
1) eclipse-> window-> preferences-> General-> content types
2) Find the type of the file to be modified. There is a default encoding below, and enter GBK in the input box.
3) Click Update.
4) Click OK.
5) Restart eclipse

Open the source file, everything is OK, no garbled!

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.