Eclipse Common debugging shortcut keys __eclipse

Source: Internet
Author: User
Preface

Master IDE Debugging shortcuts convenient for us to quickly locate the program bug location, for problem solving and efficiency has great help


Eclipse shortcut key settings and modifications

about how to set and modify shortcut keys: Select the menu bar of the window->preferences-> General->key, select a shortcut function, set and binding below, the specific method here no longer repeat. For shortcut key settings, it is best to use the default way, the default shortcut keys used for a long time will naturally become a habit, and in the team with the Hu to bring convenience, if they have their own set of shortcuts and habits, it is inevitable to communicate with others when the code obstacles.



the most commonly used shortcut keys ctrl+1

Quick Fix key ctrl+1 is the most commonly used shortcut in Eclipse, a bit like the fast using class in VS, in the development of IDE usage, as long as you see the fork, you can use the Quick fix key, it can help you to supplement the related package references are not imported, you should use Trycatch, etc.


debugging the most commonly used shortcut keys F5, F6, F7, F8 The most frequently used when debugging the program is the number of shortcuts, which: F5: Step into the inside of the method; F6: Next line of code, step by line; F7: Return to the next line of code at the call

F8: Continue running, skip the current interrupt, run to the next breakpoint, if there is no breakpoint after the current interrupt, then run the program will not be interrupted.

F11: Debugging and starting a program


The effect of the accelerator F7 the second rate is as follows, first code:

Package Javalearn;


Class parent2{  
    
    int i=10;//Parent class variable public  
      
    void SetI (int i) {  
        this.i=i;  (2)
    }  
  
class Samename extends parent2{  
    int i=10;//A variable with the same name as the parent class is public  
      
    static void main (String Args[]) {  
    	samename son=new samename ();  
    	System.out.println ("son.i=" +son.i);  
        Son.seti (m);  (1)
        System.out.println ("After SetI (m): son.i=" +son.i);  (3)
          
        Parent2 Parent=son;  
        System.out.println ("Son as parent:son.i=" +parent.i);  
    }  
      

The above code assumes 19 lines to break point, debug the startup program, interrupt here, press F5 into the method Seti inside, when the breakpoint will jump to 9 lines, then press F7, then the code will return to the call, that is (3) of the position, line 20th


Other common shortcut keys

Formatting: ctrl+shift+f formatting to its code

Case conversion: Ctrl+shift+x to uppercase ctrl+shift+y to lowercase

Setter and Getter shortcut key constructs: shift+alt+s pop-up box selection setters and getter constructs

template annotation shortcut keys: shift+alt+j

Code Quick Comment/**/:ctrl+shift+/

Line Comment//:ctrl+/

Renaming: Alt+shift+r

View variable values (when debugging): Ctrl+shift+d or Ctrl+shift+i

Collapse code and Unwind code: Ctrl+shift+numpad_divede (keypad/number)
Ctrl+shift+numpad_multiply (* Number of keypad)

Search: Ctrl+h

Find and Replace: ctrl+f

New Item: CTRL + N

New file: Alt+shift+n

Comments/Uncomment: ctrl+/

Delete Current line: Ctrl+d

View method Description: F2

View source code, statement: F3

Back, cancel last edit: Ctrl+z

Saving: Ctrl +s,ctrl+shift+s

List all current shortcut keys: ctrl+shift+l


reference materials:

Eclipse Breakpoint Debugging

Nine tips for Eclipse debugging Java programs

Eclipse Common Settings, common shortcut keys

Java Development environment------MyEclipse shortcuts and Troubleshooting First Choice ctrl+1 (* * key ***:ctrl+1, quick fix---a bit like the fast using in VS

If there is a mistake, please small partner to correct, grateful, violent go!



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.