Pinterest Stumbleupon Whatsapp

eclipse keyboard shortcutsI recently had two pair assignments for class, each of which had to be with a different classmate. With the object of programming for Java, we utilized Eclipse as our IDE The Top 3 Browser-Based IDE's To Code In The Cloud The Top 3 Browser-Based IDE's To Code In The Cloud Read More simply because that was what we were taught to use. I tried learning VIM The Top 7 Reasons To Give The Vim Text Editor A Chance The Top 7 Reasons To Give The Vim Text Editor A Chance For years, I've tried one text editor after another. You name it, I tried it. I used each and every one of these editors for over two months as my primary day-to-day editor. Somehow, I... Read More editor Geany - A Great Lightweight Code Editor For Linux Geany - A Great Lightweight Code Editor For Linux Surprisingly, Linux doesn't offer that many good IDE's (Integrated Development Environments). I believe this is because back in the day most Linux programmers took out good old Notepad (or gedit in this case), and started... Read More keyboard shortcuts, but I have not been using it daily so I was fine with using Eclipse, which seemed to make everything a lot easier. You can see a list of all the files in your Java (or Android for that matter) project in the package explorer, easily navigate to the desired function with the outline window, get suggestions for functions, imports, and more.

Anyhow, since my partners and I worked with Eclipse, my first partner taught me a few keyboard shortcuts, which I then taught to my second partner, whom did not use “sysout” or any Eclipse shortcuts (if you do not know what “sysout” means, you’re reading the right article!). Thus, the reason for this post was born – to go over some very useful keyboard shortcuts for actions you’ll probably perform often.

If you are a frequent reader of this post and have contemplated programming for a little while, ponder no longer. We at MakeUseOf have compiled a few 2 Websites & 2 Apps That Can Help When Learning Java Programming 2 Websites & 2 Apps That Can Help When Learning Java Programming There are plenty of people I know who'd like to know how to program, yet they're confused by how to start and what the general ideas of programming are. In addition, there are a large... Read More lists to websites that will guide you through Java Learn How To Write Programs In Java With Greenfoot Learn How To Write Programs In Java With Greenfoot Greenfoot takes care of learning a programming language by providing a developing platform, meant for educational purposes, where users can quickly get started and get visual results back in the form of graphics. Greenfoot runs... Read More (or C++ 3 Websites To Get Started With Learning C++ Programming Language 3 Websites To Get Started With Learning C++ Programming Language Learning to program can be difficult for many, even with relatively easy programming languages. While Java is easier to get started with (where we have numerous articles here at MakeUseOf for Java as well as... Read More ) lessons and examples Top 5 Websites for Java Application Examples Top 5 Websites for Java Application Examples Read More . What if you’re unsure of what language to start with? We also have you covered with suggestions for web Which Programming Language to Learn - Web Programming Which Programming Language to Learn - Web Programming Today we're going to take a look at the various web programming languages that power the Internet. This is the fourth part in a beginners programming series. In part 1, we learnt the basic of... Read More and software Which Programming Language Should You Learn For Software Development? Which Programming Language Should You Learn For Software Development? When starting on the path of programming, it’s important you invest your time wisely in choosing to learn something that will both benefit you in the immediate future with visible results on your platform of... Read More development. So once you’re done browsing through our development collection, feel inspired to start programming, and have Eclipse installed, you might want find the following tips useful.

Control + Shift + O: Import

If you’re going to use ArrayList, LinkedList or any other such data structure class from the Java Collections Framework, you will need the following lines above your class declaration and constructor.

import java.awt.List;
import java.util.ArrayList;

public class Hello {
  public static void main(String[] args) {
    System.out.println("Hello World!");

Instead of having to type the import lines, you could just write your code first in the editor and whenever you see red squiggly lines signaling that you need to import a specific class, all you have to do is press Ctrl + Shift + O and ALL the unknown types will be imported. No more going into the focus popup and pressing Import for each class.

Control + I: Indent

Is your code looking like this at times?

eclipse keyboard shortcuts

Simply highlight the code portion that looks hard to read, press Ctrl + i to indent everything nicely.

keyboard shortcuts eclipse

Control + D: Delete Line

If you need to delete a line, you might usually highlight the entire line with your mouse (or with the Home or End buttons) and delete the new line character every time. Try Ctrl + D for quick whole-line deletion. It will be like the line was never even there, no final new line character touchups necessary.

keyboard shortcuts eclipse

Control + Space: Auto-Complete Variable Or Function Name

If you have declared and initialized at least one variable or even function or method, you can type the first few letters of the variable or function name, hit Ctrl + Space to auto-complete it. This will work well if you have very unique variable or function names, because otherwise, you’ll have to choose among the distinct names in a focus popup window.

keyboard shortcuts eclipse

Sysout + Control + Space: Puts System.out.println()

If you ever need to type out a print statement, in particular, “System.out.println()”, there’s a shortcut for this: Simply type out the word “sysout” and then hit Ctrl + Space.

eclipse ide keyboard shortcuts

Control + H: Search Your Entire Project

When you’re working on projects with numerous classes that rely on each other, sometimes you might forget where it was you declared a specific function or variable. If that’s the case, Ctrl + h will come in handy as it lets you search through not just the class you’re working on, but the entire project folder.

eclipse ide keyboard shortcuts

Control + F11: Run

If you’re constantly pressing on Run As > Java Application, you can instead press on Ctrl + F11 to run your program.

eclipse keyboard shortcuts

Alt + Shift + R: Rename

When you want to rename a variable or a function, you don’t have to re-type every single instance of the old variable or function name, nor do you have to right-click on the name and select Refactor > Rename when you can simply press Alt + Shift + R to rename ALL the instances.


What other handy tips do you have for beginners? Let us know in the comments below!

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Balaji
    August 19, 2016 at 1:16 pm

    @Sagar, (CTRL + SHIFT + L) its a very helpful key to access all the shortcuts. Thanks a lot.

  2. Sagar
    June 9, 2016 at 10:07 am

    CTRL + SHIFT + L
    To open list of all shortcuts

  3. Anonymous
    July 14, 2015 at 5:33 pm

    1:- CTRL+SHIFT+Y for small letters (beanmain)
    2:- CTRL+SHIFT+X for capital letters (BEANMAIN)
    3:- CTRL+SHIFT+C for comment selected lines.

    • WebEpic
      April 11, 2016 at 12:10 am

      For Mac Users

      1:- COMMAND+SHIFT+Y for small letters (beanmain)
      2:- COMMAND+SHIFT+X for capital letters (BEANMAIN)
      3:- COMMAND+SHIFT+C for comment selected lines.

      • WebEpic
        April 11, 2016 at 12:14 am

        The above holds true for many of the other shortcuts that come after these as well.

  4. Aloke
    January 30, 2015 at 5:21 am

    Any shortcut key to copy entire line without selecting?

    • Richard
      April 8, 2015 at 12:09 pm

      Ctrl-ALT Down to copy and paste the entire line

      • Anonymous
        July 14, 2015 at 5:35 pm

        Ctrl+ALT+Down is for change tab on Editor.

  5. daviep73
    October 18, 2012 at 10:55 pm

    Highlight block of code then Ctrl-/ to comment it out....

  6. Oded Arbel
    May 22, 2012 at 10:28 am

    Oh, and so much more! (and some more useful, IMHO):
    - CTRL+SHIFT+T : open fast type browser - start typing your class name to filter the list (also accepts wildcards, like *StuffFacade) then use the up-down cursor keys to open the type.
    - CTRL+SHIFT+R : open fast file browser - like the above, but for files, so its useful when developing non-Java code.
    - CTRL-O : fast outline browser - to jump to a method, hit they keys then start typing the method name until the list is small enough so you can up-down to the required method.
    - ALT-F8 : switch between perspective in a LRU manner (like ALT-TAB for applications)
    - F12 : go to editor - if your keyboard focus is in any other view, move the keyboard to the editor view. Also, ALT-SHIFT-Q opens a fast list of all viewes you can access with a keyboard shortcut (that is in the default form of ALT-SHIFT-) so you can easily switch to the required view without remembering the actual shortcut.
    - CTRL-E : open a fast list of editor tabs (including those not visible in the tab bar, which are marked in bold) to easily find the editor tab you need. This list also supports type-to-filter.
    - ALT-Up/ALT-Down : move the current line (or lines selected) in the editor up or down one line while fixing indentation (so moving the line into an indented block will indent the line correctly). Very useful for quick refactoring.
    - F2 : Quick Javadoc - opens a floating dialog with the javadoc for the symbol the cursor is on. Use up-down to browser the documentation and ESC to dismiss.

  7. khendar
    May 22, 2012 at 2:56 am

    Control + L is Go To Line Number
    F3 takes you to the declaration of a function or variable