Showing posts with label Eclipse. Show all posts
Showing posts with label Eclipse. Show all posts

Friday, May 5, 2017

How to use eclipse effectively ?

Almost , most of the developers are using eclipse. But very rare developers only know all the tricky parts of eclipse IDE, means some shortcuts and way of using eclipse effectively. 

Here I am providing lot of wonderful tips and tricks of using eclipse. Remember this handling techniques you must do it again and again. I assure your productivity will increase compared to your earlier.

1. What is Open Type in eclipse ?

    Shortcut is Ctrl + Shift + T, Which will open any class , interface etc., Remember Ctrl + Shift +       R, which will open a files.

2. What is quick outline and How to use that ?

    Shortcut is Ctrl + O,  which will show you all the methods available in the current class. Press once again Ctrl + O,  which will show you inherited members for current class.

You can search method or inherited members also possible at the top search box.

3. What is open Type Hierarchy ?

    Shortcut is Ctrl + T or F4 , which will show you the hierarchy of your files. Means, inheritance class or implements interface. If you will press again Ctrl + T, it will only show you the super type hierarchy.

4. Search with eclipse Java Search File Search Method search etc.,

   You can click Search icon from the toolbar or Shortcut is Ctrl + H or by menu Search -- > Search, which will show you the effective way for search method , package , constructor etc.,

If you dont know the exact name of method or any other searchable word, just use * . eg. *action

5. What is open Declaration ?

    Right click on variable or object whatever it is, click open declaration or Shortcut F3,  which will show you where it was declared.

6. What is open call hierarchy ?

    Really a wonderful feature by eclipse to check where the caller, callees etc., Shortcut is Ctrl +Alt + H,  After call hierarchy window open check the right corner menu to get more like caller Hierarchy, callee hierarchy , history etc.,

7. References in eclipse ?

    Shortcut is Ctrl + Shift + G, it will show you related references from work space , Project , Hierarchy etc.,
    
8. Generate constructors using fields ?

     Like generate setters and getters there is an option to generate constructor also based on your class field. You can travel by Alt + Shift + S or go by Right Click.


9. Templates , how to use ?

   Eclipse templates will give you the best shortcut option for your code, for eg , sysout and putting Ctrl + Space will show you Syste.out.println . Like this you can create your own template.

I will post a separate topic , how to add new template in eclipse. Until then If you want to check about templates, Window - > Preferences - > Java -> Editor -> Templates.

12. Formatting source code by eclipse ?

   Shortcut is Ctrl + Shift + F,  which will format your source code. Suppose if you need your own style format code you can add it by code Style option. 

13. Refactor code in eclipse for local variable constants and method?

   Code refactor is the big topic , and I will post you the separate post for this. Its nothing but, will you an option to rename the method or variable or whatever , it will reflect all place. Moving the code , extract the code also possible.

14. Enable line numbers 

   Line number of the code is useful when you get error which will show nth line number missing ; So if you enable line number , you can go directly to code line.

To enable Right click side bar of the code and select Show Line numbers option.

Friday, March 11, 2016

software being installed m2e - slf4j over logback logging (optional) 1

Almost most of the developers are facing this issue and its getting irritate. But its simple to solve by below ways.

1.Go to help – Install new software
2.Add the below URL.
   2.1. http://download.eclipse.org/releases/indigo/
3.Add it. Once you after add, it will load all list.
4.After list loads, Under "General Purpose Tools" check "m2e - Maven Integration for Eclipse".
5.Continue with your installation to proceed further.
6.Once done, eclipse will ask you to restart eclipse.
7. Restart it. PROBLEM SOLVED.

Friday, September 25, 2015

resource is out of sync with the file system in eclipse

Try the below solution when you get resource is out of sync error. 

Window -->Preferences-->General-->Workspace

Right side you able to see check box[Refresh using native hooks or polling].

Please refer below image. 

 

Wednesday, September 16, 2015

Cannot complete the install because one or more required items could not be found. Software being installed: m2e - slf4j over logback logging (Optional) 1.4.0.20130601-0317

 Help-->Install New Software

maven install
Installing Maven
After adding the below URL, that child details will be populated, then click Next and continue further.

If you are unable to install maven with below URL in eclipse.

Url: http://www.fuin.org/p2-repository/

Try the below one, Its worked for me.

http://download.jboss.org/jbosstools/updates/m2eclipse-wtp/

Saturday, May 3, 2014

No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

You may get this error while doing build with Maven. Here the solution,

Just follow the images and provide the information based on that,



After that, follow the next screen , remember select execution environments inside Installed JREs.