Fix Eclipse @author under any account

PDF

Here’s a quick tip I found very useful in Windows, involving Eclipse template system and the @Author annotation.

Say you are working under some kind of account, for example some assigned number combination which you use to log into Windows or something. Mine recently was AA170738. Now say you are editing Java classes in Eclipse and generating comments with Eclipse. You might end up with something like this:

I Found this very annoying since it happened to me for every class I introduced and templates are supposed to save time. You could ofcourse turn it off entirely, Preferences->Java->Editor->Templates->uncheck @author, but I just wanted it fixed the right way.

Turns out Eclipse simply reads out the Java system property user.name. All we need to do then is boot Eclipse with an explicit system property. Like so…

eclipse.exe -vmargs -Duser.name=”John Doe”

Just change that in your shortcut and you’re set.

Tags:
  • tanjir

    The quote is not necessary.. the correct form should be : -Duser.name=John Doe
    This option can be added in the “eclipse.ini” file under eclipse’s root directory of installation.

    Reply

Leave a Reply to tanjir Cancel Reply