Victor2748
Victor2748

Reputation: 4199

Eclipse: change default file templates

How can I change the default file templates for new classes, interfaces, JavaEE servlets, etc. in Eclipse? I know that it is possible somehow, but I did some research, and haven't found any information about it.

Upvotes: 3

Views: 1928

Answers (2)

Karthik
Karthik

Reputation: 76

To change default templates of Class, Interfaces and etc you need to navigate to following location in eclipse

select Window --> Preferences, then Preferences window will be opened.From the left part of window, Expand "java" option by clicking on it. Then Expand "CodeStyle" option by clicking on it. Then select "Code Templates" option. You can find "Configure generated code and comments" box at top of the window at right position. Expand "Code" option by selecting it. Then you can find list of templates. You select one template which you want to change and click on "Edit" button. Then, "Edit Template" window will be opened, there you can define the pattern and click on "Ok" button and as well as "Apply" buttons.

Find below screen shot

Upvotes: 3

WrongRhyme
WrongRhyme

Reputation: 166

Try Window -> Preferences -> Java -> Code Style -> Code Templates.

There you can edit existing code templates and even import new ones.

Upvotes: 4

Related Questions