Thursday, August 15, 2013

Running a Debug in Eclipse: (Also useful for Remote Java application)



Running a Debug in Eclipse:

(Also useful for Remote Java application)

We just need to connect the sourcecode in eclipse to your eclipse debug (that will automatically detect a running tomcat on your machine) .

*   Open Eclipse 
* Select Debug Configuration (below the Bug Picture)
It opens the following  panel
Select the Remote Java Applications menu from the left panel
Fill the name of the debug in which you want to run
Browse and select the source code on which debug should run
(P.S. You don’t need to change Host and Port generally for any tomcat running on local system)
Click on Debug , and its  Done .

* Note : If an error message appears like following  then your debug is already running.


Go to debug perspective (For both purpose either to close or look into already running Debug)

And Click on this symbol to close the already running Debugger .


Or To Use the Debug , Do some action on the web application ,like in my case I am submitting a form


The Debug appears at the point you added the debug




Press F8 (which is also Resume button),that will take you to the break point from there debug each line with F6.
If you want to go to next break point press F8.



Tuesday, August 6, 2013

Some interesting Eclipse Short-cuts



Shortcut for "Key" related Help :
CTRL + Shift + L.

Function Call Hierarchy :
 CTRL+ALT+H

For adding java doc comments to whole file :
CTRL+ALT+J

Open any file quickly java ,jsp,xml etc :
Ctrl + Shift + R

For Java type in or outside workspace(like in jars) :
 Ctrl + Shift + T

Go directly to a member (method, variable) :
Ctrl + O

jump from one member to the next (or previous) :
Ctrl + Shift + ↓ or Ctrl + Shift + ↑

Go to the last edit location:
Ctrl + Q

Go to a supertype/subtype:
Ctrl + T.

Go to other open editors:
Ctrl + E /