Skip to content

Eclipse configuration

Mikhail Niedre edited this page Jul 4, 2014 · 1 revision

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

  1. Open Eclipse, go to Window -> Preferences -> Java -> Code Style -> Code Templates -> Comments -> Types and then press the 'Edit' button. There you can change your name in the generated comment form @Author ${user} to @Author Rajish.

  2. Rather than changing ${user} in eclipse, it is advisable to introduce -Duser.name=Whateverpleaseyou, in eclipse.ini which is present in your eclipse folder.

  3. There is a small “hack” which can put anything you want in this ${user} variable. Rather than having to change the template manually, add -vmargs -Duser.name="cleverUserNameIWantToUseInSourceCode" to the shortcut you use to run Eclipse ( by right clicking on it, selecting properties and editing the target input field) :

C:/java/eclipse/eclipse.exe -vmargs -Duser.name="cleverUserNameIWantToUseInSourceCode"

Clone this wiki locally