How do I change the Javadocs template generated in Eclipse?

前端 未结 5 438
渐次进展
渐次进展 2020-12-04 12:06

I dislike the default Javadocs generated for me when I create a Class or methods, especially the @author variable, which is the current system username on my windows box.

5条回答
  •  -上瘾入骨i
    2020-12-04 12:25

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

    Code Templates


    However, if the template is fine, but the value referenced buy the author tag is not, see this SO question:

    ${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"
    

    • MacOs: Aram Kocharyan mentions the eclipse.ini is in Eclipse.app/Contents/MacOS/ if you right click and go Show Package Content.
    • ZendStudio: rofflox comments the file is named ZendStudio.ini and is found in Applications/Zend Studio.app/Contents/MacOS/.

提交回复
热议问题