Eclipse Basic Settings----Chinese garbled, line number display, indentation method, line end space and blank line automatic deletion, common annotations

Source: Internet
Author: User

First, Chinese garbled

Window System, when you import new items in Eclipse, you may encounter problems with Chinese garbled characters.

Solution: Change the system default format to GBK to UTF-8. Here are the specific workarounds that you can choose from, depending on your needs.

1. Set the encoding for the entire workspace, which affects the project for the entire workspace.

Setup Steps: Menu bar Window--Preferences--general--Workspace--text file Encoding--other--utf-8, save configuration (Apply and Close).

  

2. Set the encoding of the project, which affects only the selected items.

Setup step: Select Project Right--Properties--Resource--text file Encoding--other--utf-8, save settings.

  

3. Set the encoding of individual files, this action only affects the selected files.

Setup step: Select File Right--Properties--Resource--text file Encoding--other--utf-8, save settings.

  

Second, eclipse shows the number of lines of code, space, and tabs (tab)

Not set before:

  

Setup Steps: Menu bar Window--Preferences--gerenal--Editors--Text Editors, save settings.

(The number of lines can also be directly used CTRL+F10, then check show line Numbers)

  

After setting:

  

  

Three, set the indentation mode (one tab is four spaces)

Setup steps:

1), Set Indent: Menu bar Window--Preferences--gerenal--Editors--Text editors--insert spaces for tabs, save settings;

  

2), configure tab to 4 spaces in formatter:

i), menu bar window--Preferences--Java--Code Style--Formatter;

    

II), create a new file, the configuration is as follows, save;

    

III), Source-format, for formatting.

Four, automatically delete the line at the end of the space and empty lines (the phenomenon is left to right image)

Setup steps: Window--Preferences--Java--Editor--Save Action-Perform the ...--Additional actions--Configure ...--Re Move trailing whitespace--all lines

  

    

V. Common annotations

Setup Steps: Menu bar Window--Preferences--Java--Code Style--code Templates--Comments

1. Files--Edit

/**   * @Description: * @Package ${package_name} * @Title: ${file_name} * @author SUCB * @date ${date} */
Files

  

  

2, Types--Edit

/** @Description:  * @Package ${package_name}  * @Title: ${file_name} * @author SUCB * @date ${date} */
Types

    

3, Methods--Edit

/** * ${tags} * @author SUCB * @date ${date} * *
View Code

  

    

  

  

Eclipse Basic Settings----Chinese garbled, line number display, indentation method, line end space and blank line automatic deletion, common annotations

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.