Eclipse shortcut keys

Source: Internet
Author: User

Transferred from: http://usenrong.iteye.com/blog/1113700

Eclipse is an open source product that is currently more popular and popular with the Java IDE (integrated development environment) which is managed in an engineered manner. Although eclipse is the basic framework for generating applications, it can run C + + programs on its platform, but Eclipse is really Java-born. For eclipse I think it should be praised, at least its update speed, and the courage to accept the shortcomings of the last version of the criticism, in the new edition to compensate. To some extent, the eclipse's stride has injected a lot of energy into Java.

1) Eclipse's literal meaning is the eclipse, which obscures sun's meaning. Full sun Eclipse Total eclipse.

2) The most important shortcuts:CTRL + SHIFT + L : Tell you all the shortcuts. The following commonly used shortcuts, especially the latter three in large-scale project management is very practical, if the "find ..." on the ground a little:

Ctrl+1 Quick Fix

Ctrl+d Delete When moving forward

Ctrl+o is the letter O, when a class is selected, all of its methods are displayed quickly.

Alt+↓ the current line and the next line of interaction (if you keep pressing, the equivalent of cut copy)

Alt+↑ the current line and the previous row interaction position

alt+← the previous edited page (used with CTRL + Q: Navigates to the last edited place)

alt+→ the next edited page

Ctrl+t quickly displays the inheritance structure of the current class. In addition, when an interface or abstract class calls a method, pressing this shortcut will show who implemented this method.

ctrl+shift+ O quickly add the classes in the import package.

Ctrl+shift+t quickly find the class name in the current project

Ctrl+shift+r find any resource in the project, R is the meaning of resource (extremely common)

Ctrl+shift+g Select the name you want to find (whether it is a class name, method name, variable name), it is very useful to quickly list the place where the given name appears. For example, find out where your defined classes are used, and find out where the variables you have defined have occurred.

Alt+shift+j Add a comment to the variable, method, and class where your mouse is located. This is an annotated way of comparing specifications, and after adding comments, you can see the comment description directly when hovering over the mouse. This shortcut will automatically recognize classes, methods, variables, and add different code comment blocks.

3) Installing the Eclipse directory name is best for Eclipse. If any other name, the system automatically creates an Eclipse folder under the D drive.

4) If you successfully overwrite a method, the left side of eclipse will inevitably prompt for a solid upward triangle, if it does not appear, the method you write to overwrite may be incorrect permissions, or the return type is incompatible, or the method name is inconsistent. If it is a hollow upward triangle, you have successfully implemented a method within an interface.

5) allows you to quickly get the method name or object name prompt when you enter any letter in the edit, and in Window > Preference > Java > Editor > Content Assist check Enable Auto Activ ation. In auto activation triggers for Java, enter:. ABCDEFGHIJKLMNOPQRSTUVWXYZ (, ABCDEFGHIJKLMNOPQRSTUVWXYZ

6) In the beginning of the study of Java, you will certainly write a lot of test class, Test class in general with the Main method and println method, then when you create a new class, you can automatically add these two code,windows> preference > Java > Code Style > Code template > Right class body > Edit

7) When Project executes the JVM, usually due to copy, delete, move, so that the compiler does not compile in time, there will usually be unexpected errors, such as: Noclassfound, or the main method execution error, etc., even if you project/build all or build Automatically can not solve the problem, then please use Project/clean ... Command would discard all build problems and built Staes. The projects is rebuilt from scratch. Then select the project you want to compile.

8) Eclipse can run multiple unrelated projects, or multiple main methods within the same project, but the console has only one default, which can be toggled by clicking on the Display selected console in the upper-right corner of the console view. Of course, you can also click on the Open console in the top right corner and the new console view opens a separate console window.

9) If you are temporarily concerned about the project you are in, or the package you are in, then right-click "go into" in the Packages Explorer and restore to the upper-right corner of the same window: up to working sets.

10) in the English version of the Eclipse system, if a Chinese character appears in the code, the following error message may appear:

Save could not being completed.
Reason:
Some characters cannot be mapped using "Cp1252" character encoding. Either change the encoding or remove the characters which is not supported by the "Cp1252" character encoding.

Workaround: Eclipse's default encoding is cp1252. To solve this problem, either change the internal encoding or remove the characters that do not support Cp1252 encoding. Modify Eclipse System settings: Windows->preferences->general. Open Click Workspace. The text file encoding, which appears on the right, is the literal encoding: Default cp1252. Click the other: drop-down menu to select UTF-8. Choose to compile the program!

One) The main method often has parameters, how can parameters be entered in eclipse? In the Run configuration .... > Program arguments >, the only thing to note is that the input character is what you see and cannot be quoted, even if you want to get \ n, it is also written, not escaped. Below are the parameters of the JVM, such as setting the maximum heap memory.

Eclipse annotations can be used in Chinese, but when using Chinese, be aware of the encoding, in Preference > general > Workspace > Text file encoding > default is GBK, if you use other encoding methods , prone to garbled problems, it is strongly recommended to use GBK, then GBK is what?

GBK is a Chinese character coding standard, the full name of the Code extension Code (GBK), English names Chinese Internal code specification, GBK down with GB 2312 encoding compatible. While the Utf-8:unicode transformationformat-8bit, the BOM is allowed, but usually does not include the BOM. is a multi-byte encoding used to solve the international character, which uses 8 bits (or one byte) in English, and Chinese uses 24 (three bytes) to encode. UTF-8 contains the characters that all countries in the world need to use, and is an international code with strong versatility. UTF-8 encoded text can be displayed on browsers that support the UTF8 character set in each country. For example, if it is UTF8 code, it can display Chinese in the foreigner's English ie, they do not need to download IE's Chinese language support package. GBK, GB2312, and UTF8 must be Unicode encoded to convert from one to the other.

When annotations appear incompatible with encoding, be careful not to close, eclipse will generally prompt: Some characters cannot be mapped using "GBK", charactor encoding, if through the task manager strong off, Even if you restore the original encoding method will also form garbled.

Eclipse EE in Project Explorer, collapse All can quickly retract all branches, very convenient; the link with editor button makes the edit box associated with the location of the package; custom View ... You can set what engineering elements are not visible.

Eclipse shortcut keys

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.