How can I change @author tag configuration in eclipse in such a way that it takes the name I have specified?

RAS picture RAS · Dec 20, 2012 · Viewed 54.9k times · Source

I'm using Eclipse Indigo for Java.

I used to write comments over the methods. In that whenever I use @author tag, it automatically takes the username of the system who is currently logged in.

My question is : How can I change this @author tag configuration in such a way that it takes the name I have specified.

I have gone through the following link:

How to change the value of ${user} variable used in Eclipse templates

But it suggests to change the value of classpath variable $user. I don't want to do that. I want to change comment template through configuration.

Answer

Perception picture Perception · Dec 20, 2012

There are several ways of accomplishing this. Open up Eclipse Preferences, type in Templates as your Filter, then select Java->Code Style->Code Templates. In the Code Templates widget, expand the Comments widget:

Eclipse Preferences - Java Code Templates

Looking through the expanded selection, you can see that there are templates defined for Types and Methods, amongst others. Select whichever template you want to edit, then click 'Edit'. You can now change the template as you see fit, for example by adding @author ${user} or whatever else to it:

Eclipse Preferences - Java Code Templates - Methods

Click 'Ok' out of all the dialogs to complete and save.