Setting and shortcut keys for compiling Java code in eclipse

Source: Internet
Author: User

The following code style and format

Shortcut Key-for a single file

1. crtl + Shift + O

Automatic Processing of import statements (less addition, more deletion, is very suitable for more)

2. CTRL + Shift + F

Automatic formattingCode

Set

1. Set the number of characters in each line of code

Window --> preferences --> JAVA --> code style --> Format

Create a new profile. Then edit this profile

Go to line wrapping --> maximum line width. We recommend that you change from 80 to 120.

In this way, when Ctrl + Shift + F is formatted, the number of characters in each line of code is 120.

2. Batch automatic processing import

Go to the Java view, right-click the project and choose source --> organize imports

3. Batch format code

Right-click the project and choose source> format.

4. Set the number of lines displayed on the console and the default pop-up

In the preferences-> Run/debug-> console, remove the limit console output selection or select to set the buffer size setting value.
Settings pop-up (the console window also has corresponding buttons ):
Preferences-> Run/debug-> In the Console
Deselect the option before show when program writes to standard out (when a value exists in the console ).
And show when program writes to standard error (when an error occurs in the console ).

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.