Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ IDEA - omit default Java class header generation

Every time when I use IDEA and create a Java class with normal "New Java class" menu option, it generates an ugly and useless Javadoc-style header before the class itself:

/**  * Created by greycat on 18.03.14.  */ 

I might rant a lot on why is it useless, for example:

  1. I would have authorship & timestamps in my VCS anyway
  2. It blatantly breaks any Javadoc documentation practices (for instance, using @author or @since tag)
  3. It uses ugly, ambiguous, locale-specific date format

Is there a way to disable this behavior, i.e. just create normal, clean class template, without this header?

like image 982
GreyCat Avatar asked Mar 18 '14 08:03

GreyCat


People also ask

How do I ignore a class in IntelliJ?

So the easiest way to exclude your test is to create a third source folder, call it /ignore, and not mark it as a source folder in IntelliJ. You can then drop any file you don't want to include in your compilation there temporarily, and drag it back to its original folder when you want to continue working on it.

How do I change the main class name in IntelliJ?

Press Shift+F6 or from the main menu, select Refactor | Rename. next to the highlighted element. You can press Tab to open the context menu and select the additional rename options. If you want to see the Rename dialog with more options, click the More options link or press Shift+F6 .


2 Answers

After the class is generated you can click on the generated text and press alt-enter. This shows you an option to edit the template.

like image 81
Geoffrey De Vylder Avatar answered Sep 20 '22 18:09

Geoffrey De Vylder


The following is valid for IDEA 13.x.

Files -> Settings, under IDE Settings, select "File and code templates".

In the right panel, you will see several tabs: choose "Includes". There is a "File Header" entry: select this, modify and save.

Note that this header applies to all file types.

Note also that this is a separate setting from copyright notices, which you can set per project.

like image 28
fge Avatar answered Sep 19 '22 18:09

fge