Prior to using annotations, they should be enabled in project.
- Click to open the project structure dialog.
- In the Project Structure dialog box, click Libraries.
- Click . Select Library Files dialog box opens.
- Under that <IntelliJ IDEA home> directory, select lib/annotation.jar,
and click OK:
- If your project contains more than one module, choose the desired module to be modified, and
The new library is added to the classpath: