124

When creating a new class or interface in Netbeans IDE, an "@author ...." tag appears. How to change its value? If possible, I would like to change it by using Netbeans menu and not by editing some config files :) I'm using Netbeans 7.2

H. Pauwelyn
  • 13,575
  • 26
  • 81
  • 144
Lukasz Czerwinski
  • 13,499
  • 10
  • 55
  • 65

4 Answers4

241

Steps:

  1. Go to Tools -> Templates.

  2. Click on Settings button. A new panel with template settings will appear in your IDE:

  3. Uncomment the last line and change the value of "user" to what ever you like to be inserted after the @author tag.

PS: I think this blog will better explain how to update author template

Anand Tripathi
  • 14,556
  • 1
  • 47
  • 52
Ravindra Shekhawat
  • 4,275
  • 1
  • 19
  • 26
  • 7
    You might also want to do a Find and Replace(Ctrl + Shift + H) for changing all the already place **@ author** tag in the project. As the change above doesn't change the already placed **@ author**. – T04435 Oct 12 '15 at 06:25
  • 2
    And don't use the angle-brackets in the dummy version initially provided, for enclosing your e-mail address. The javadoc processor will think it's HTML, and call it an error. – Stevens Miller Sep 14 '16 at 19:01
  • 2
    But this is a global setting? Can author be specific for a project? – zygimantus Jan 18 '18 at 08:35
  • @Storm, no, I haven't. – zygimantus Sep 12 '18 at 06:23
  • @Storm @ zygimantus .... Have you guys tried updating License Header and use it as template for project .?? – Ravindra Shekhawat Sep 12 '18 at 09:41
  • @RavindraShekhawat I hadn't found any options for overriding templates in project's settings. There is License Header overriding option, but if we add `@author ` at the end of license, this string will be in the beginning of the file, before namespaces, for example. While we expect that `@author` annotation should be right before class definition. Maybe I misunderstood your suggestion? – Storm Sep 13 '18 at 08:18
16

In case someone else finds this while looking for the same functionality in Eclipse: Window -> Show View -> Templates

Ryan D
  • 1,023
  • 11
  • 16
3

-In netbeans go to Tools -> Templates -> Settings -last line of the file, write like this user=xyz

N:B: Instead of xyz you could be used your name.

Arif Rafsan
  • 91
  • 1
  • 1
  • 8
0

I could not find any template or Code completion in Netbeans 15 to get rid of that @author when I added a javadoc to a class. Hence I added another code completion, cc, and let it add the javadoc.

Additional Code Completion