如何在Eclipse中设置$ {user}以获取正确的@author标签? [英] How do I set ${user} in Eclipse to get the correct @author tag?
问题描述
我正在使用Eclipse,每次创建代码时,@author设置为$ {user}的值。
不幸的是,$ {user}似乎包含我的Windows登录ID。
有没有办法通过Eclipse重写呢?
我找不到该选项。
I am using Eclipse and every time code is created, @author is set to the value of ${user}. Unfortunately,${user} seems to contain my windows login id. Is there a way to override this through Eclipse? I couldn't find the option.
推荐答案
我不知道Eclipse本身有没有办法。但是从我可以找到, $ {user}
使用 user.name
环境变量的值;因此,您可以通过eclipse.ini中的 -Duser.name = My Name
来覆盖它。
I'm not sure if there's a way in Eclipse itself. But from what I can find, ${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"
如这个博客条目。
这篇关于如何在Eclipse中设置$ {user}以获取正确的@author标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!