How to add copyright to Eclipse automatically

A quick guide to show you how to add @Copyright comment to new and existing Java files in Eclipse IDE.

Solution 1. Eclipse Code Templates

Go to preferences -> Java -> Code Style -> Code Templates, expands Code and select “New Java Files”, edit the template to add whatever copyright messages you want.

eclipse - code template

Now, that copyright message will be injected on every newly created Java class.

Solution 2. Eclipse Plugin – Copyright Wizard

Using this Copyright Wizard plugin is recommended, it lets you select a list of common copyright templates like Apache License, EPL, GPL; and apply it to new or existing Java classes automatically. In additional, it allow to update the copyright year.

1. Download and install Copyright Wizard – http://www.wdev91.com/?p=cpw

2. To edit the copyright template – select project properties, go general -> copyright

copyright-wizard-eclipse

3. To apply the copyright template to all source files – select project -> apply copyright

eclipse - apply copyright

Done.

References

  1. Eclipse plugin – Copyright Wizard
  2. Eclipse Releng Tools

About the Author

author image
mkyong
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

avatar
3 Comment threads
2 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
5 Comment authors
emptychannelmcJulianWatt Tesla FaradParassomayeh Recent comment authors
newest oldest most voted
emptychannelmc
Guest
emptychannelmc

For anyone who want Copyright Wizard, see this topic https://www.eclipse.org/forums/index.php/t/796282/ (download + how to)

Paras
Guest
Paras

wdev91.com does not resolve any more. Do you know any alternative? Thanks for the wonderful post!

Watt Tesla Farad
Guest
Watt Tesla Farad

The source appears to still be up at https://sourceforge.net/projects/eclipsecopyrigh/

Julian
Guest
Julian

But we need a update site so that we can use it inside eclipse!?

somayeh
Guest
somayeh

In The Name Of Allah
Hello
Your website is very good.I have a question but i haven’t your email. Please present to me an example of email validation that has entered to edit text through user in an android application with screenshots as your other examples. Thanks alot