可能重複:
How to change the value of ${user} variable used in Eclipse templates
我使用Eclipse和創建的每個時間碼,@author設置爲$ {}用戶的價值。 不幸的是,$ {user}似乎包含我的Windows登錄ID。 有沒有辦法通過Eclipse覆蓋它? 我找不到選項。
可能重複:
How to change the value of ${user} variable used in Eclipse templates
我使用Eclipse和創建的每個時間碼,@author設置爲$ {}用戶的價值。 不幸的是,$ {user}似乎包含我的Windows登錄ID。 有沒有辦法通過Eclipse覆蓋它? 我找不到選項。
我不知道如果Eclipse本身有方法的話。但從我所能找到的,${user}
使用的值爲user.name
環境變量;因此,您可以在eclipse.ini中傳遞-Duser.name=My Name
來覆蓋它。
或者,如果你願意,你可以修改快捷方式指向:
C:/java/eclipse/eclipse.exe -vmargs -Duser.name="cleverUserNameToUseInSourceCode"
Windows > Preferences > Java > Code Style > Code Templates > Comments
選擇Types
和編輯模板中插入另一個值(可能是一個固定的現在,或更改user.name property爲mmyers建議)
/**
* @author myUserValue
*
* ${tags}
*/
我其實只是去發佈這個答案後做了這個。這意味着我現在有義務將問題提升爲「有幫助」。 – 2009-06-01 17:13:22
作爲開發架構師,我編寫了許多手冊和「循序漸進」的安裝過程。根據我的經驗,總是需要插圖;) – VonC 2009-06-01 18:59:21
對於那些不確定在哪裏找到eclipse.ini文件,它可能位於Eclipse安裝目錄中(或者對於Mac中的Eclipse.app/Contents/MacOS)。這意味着如果你有多個Eclipse的安裝,你將不得不單獨更改每一個。 [參考](http://wiki.eclipse.org/Eclipse.ini) – jbranchaud 2012-01-20 19:53:47