Wednesday, December 29, 2010

How to set ${user} property in Eclipse?

Select 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.

${user} uses the value of the user.name environment variable. You can check it via System.getProperty("user.name").


There are several solutions:
  • define it via command line:
    C:/eclipse/eclipse.exe -vmargs -Duser.name="someUserName"
    
  • define it via eclipse.ini:
    -showsplash
    org.eclipse.platform
    --launcher.XXMaxPermSize
    256M
    -vmargs
    -Dosgi.requiredJavaVersion=1.5
    -Duser.name="someUserName"
    -Xms40m
    -Xmx512m
    

No comments:

Post a Comment