Common Errors of running Java in eclipse

Source: Internet
Author: User

I. Eclipse Chinese annotation garbled Solution

When someone else's project or Java file is imported into their own eclipse, the Chinese comments of the Java file are often garbled, the main reason is that others' ide encoding formats are different from their own eclipse encoding formats (some GBK, some UTF-8 ).

To sum up the suggestions and experiences on the Internet, you can refer to the following solutions:

1. Change the encoding format of the entire file type

1) eclipse-> window-> preferences-> General-> content types
2) Find the type of the file to be modified (Java, JSP, etc.), there is a default encoding below, enter GBK in the input box
3) Click Update.
4) Click OK.
5) Restart eclipse

2. Change the encoding format of the entire eclipse Workspace

1) eclipse-> window-> preferences-> General-> workspacetypes
2) Change the encoding format of text files to GBK.

3. Change the encoding format of a single file

In package explorer, right-click File> properties to change the text file encoding format to GBK.

4. If the above methods still cannot be solved, you can do the following:

Use editplus to open the file to be transcoded. If there is no garbled code in editplus, you can directly copy the file content to eclipse. If editplus is garbled, You can first transcode the file in editplus, editplus-> document-> file encoding method-> change the file encoding method-> GBK, and then use eclipse to open it.

5. default encoding of Eclipse project/attribute/Text File
Modify to UTF-8,

6,

When you open eclipse, Chinese comments may be garbled. This is because the default encoding for text file encoding in eclipse is GBK. Therefore, right-click your "project ", change the other in "text file encoding" in info to UTF-8!

2. Open a Java programmer in eclipse

1. Create a project and select Java Project

2. Select the code path for the project path

3. Next step...

Related Article

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.