您的位置:首页 > 编程语言 > Java开发

修改Eclipse中的@author的默认值 vs 代码格式化

2014-11-24 17:01 155 查看
代码格式化:

右键-source-format能够起效,但ctrl+shift+f

修改Eclipse中的@author的默认值:

按照下图的方式设置,最后点击apply



1. 在eclipse.ini中添加

-vmargs

-Duser.name={author name}

记得一定要在-vmargs之后,否则无效。

2. 设置eclipse参数

windows-->preference

Java-->Code Style-->Code Templates

code-->new Java files

原来的内容是:

${filecomment}

${package_declaration}

${typecomment}

${type_declaration}

添加自定义内容,添加之后内容如下:

${filecomment}

${package_declaration}

/**

* @author 作者 E-mail:

* @version 创建时间:${date} ${time}

* 类说明

*/

${typecomment}

${type_declaration}

3. 设置eclipse参数

windows-->preference

Java-->Code Style-->Code Templates

Comments-->files

按照需要修改配置,并且保证上面项的配置中有${filecomment}这项。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: