views:

116

answers:

2

I dislike the default Javadocs generated for me when I create a Class or methods, especially the @author variable, which is the current system username on my windows box.

I would like to change it. Is this possible?

A: 

Look at Window -> Preferences -> Java -> Editor -> Templates.

binil
Yeah I know about that, but unfortunately this does not seem to have any effect on the code generation for Classes.I want to avoid having to do this manually
Olaseni
+3  A: 

Check Preferences / Java / Code Style / Code Template

Section Comment / Type

You can replace the author tag by whatever value you need and it will have an effect on new generated classes.

alt text


However, if the template is fine, but the value referenced buy the author tag is not, see this SO question:

${user} uses the value of the user.name environment variable; therefore, you can pass -Duser.name=My Name in eclipse.ini to override it.

Or, if you prefer, you can modify the shortcut to point to:

C:/java/eclipse/eclipse.exe -vmargs -Duser.name="cleverUserNameToUseInSourceCode"
VonC
Beautiful! Just what I was looking for.
Olaseni
Unrelated: How did you generate such a pretty screenshot?
Paul Lammertsma
@Paul: after that meme revealed itself as "mandatory" (http://meta.stackoverflow.com/questions/19478/the-many-memes-of-meta/19775#19775), I had to use FSCapture (http://www.faststone.org/FSCaptureDetail.htm) to comply ;)
VonC