Friday, March 31, 2017

Useful Eclipse IDE Tips

INTRODUCTION

The aim of this post is to share some of the useful tips for Eclipse IDE. Hope it can be helpful during development of your project.

1. how to increase eclipse console size

  1. Go to Preferences
  2. Select Console on Run/Debug
  3. Enter the value 1000000 for 'Console buffer size'
  4. Click Apply & Ok.
  5. Now you can see more logs in the console.

2. how to create java code templates in eclipse

Consider I would like to add my name, Ranjith Sekar, as an author of the java file and the current date is the date of creation of the file.
  1. Go to Preferences in Eclipse
  2. Select Java->Code Style->Code Templates
  3. Expand the Code and select 'New Java File'
  4. The default would be as below
${filecomment}
${package_declaration}

${typecomment}
${type_declaration}

  1. Click Edit and Enter as below
${filecomment}
${package_declaration}
/**
* @author Ranjith Sekar(java2ranjith@gmail.com)
* @since ${date}
*/
${typecomment}
${type_declaration}

  1. Click Ok
  2. Create a new Java file called MyNewClass.java
  3. Your class would be created as below
package java2ranjith.thiskeyword;
/**
* @author Ranjith Sekar(java2ranjith@gmail.com)
* @since Jun 26, 2014
*/
public class MyJavaClass {

}

3. how to filter .class files in eclipse file search

  1. Select your project in eclipse and right click and select Properties.
  2. Go to Resource->Resource Filters
  3. Click Add
  4. Select 'Exclude All' in Filter Type.
  5. Select 'All Children' in Apply to
  6. Type *.class into the File and Folder Attributes (Name - Matches) and click OK.
  7. The Project will be rebuilt automatically.
Now try to search any java file where you couldn't find any .class file of those.

No comments :

Post a Comment