Pages

Friday, December 28, 2007

How to set @author or ${user} properties in Netbeans 6.0 templates

This is a simple task in Netbeans 5.5, but not obvious in Netbeans 6.0. To set the ${user} variable in templates in Netbeans 6.0, you must go to Tools --> Templates. This will bring up the Template Manager screen. Scroll to the section called User Configuration Properties and expand it. You will see a template called User.properties.


Select the User.properties and Open in Editor. Uncomment the line user and set it to the appropriate value and then save the file.


Now when you create a new Java source file, the javadoc @author will be set to the new property. This same method is used to set other properties in your templates as well.

4 comments:

  1. Thank you so much! I really appreciate this info. COuldn't find it elsewhere.

    ReplyDelete
  2. Fantastic, thank you so much! (I too couldn't find it anywhere else.)

    ReplyDelete
  3. Thx man, ppl were saying some weird things to such a simple task u explained :)

    ReplyDelete