Friday, 7 February 2014

Eclipse - Shortcuts, automatic author name for new files and debugging

Shortcuts:




  • To create new files/project - Ctrl+Shift+N

  • To Search Files - Ctrl + Shift +R

  • Search a String in a file -  Ctrl+H and find file search on the tabs above and Enter the string, file type to be searched

  • Search method name in a class- Ctrl+0

  • Replace/Find String in a file - Ctrl+F

  • To run a program - Ctrl+F11



Author name in newly Created Files:




  • Go to Window-->Preferences-->in the search box type code template and expand the code. Now Select New Java Files and click Edit

  • Enter the following in the box, save and then close


  • ${filecomment}
    ${package_declaration}
    /**
    * @author ${user}
    *
    */
    ${typecomment}
    ${type_declaration}



Debugging:


Debugging with web logic Server:




  • Go to your weblogic domain(ex: C:\Oracle\Middleware\user_projects\domains\<domainname>) -->bin and find set SAVE_JAVA_OPTIONS=%JAVA_OPTIONS%

  • Replace the above line with, set SAVE_JAVA_OPTIONS=%JAVA_OPTIONS% -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n

  • Go to eclipse, on the top right side corner select the debug perspective as below



[caption id="attachment_368" align="aligncenter" width="591"]eeclipse perspective eeclipse perspective[/caption]

  •  Now click on debug and select configurations as below.


[caption id="attachment_369" align="aligncenter" width="652"]debug configuraion debug configuraion[/caption]

  • Enter the configuration details as below and click debug.


new configuration

 

  • Now the application is enabled with remote debugging. We can add breakpoints in the code and when you run the app press f6 to go line by line. And press f5 for method definition.

No comments:

Post a Comment