Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Lombok in IntelliJ shows create constructor message

I have added Lombok annotation(@NoArgsConstructor and @AllArgsConstructor) for my following object:

package com.example.demo.student;

import lombok.*;

@ToString
@Getter
@Setter
@EqualsAndHashCode
@NoArgsConstructor
@AllArgsConstructor
public class Student {
    private Long id;
    private String name;
    private String email;
    private Gender gender;
}

The code can be compiled and the application can be run without any issue.

However, the IntelliJ still shows warning red lines about creating constructor like the following screenshot.

Can't IntelliJ recognize Lombok annotations?

Is there any way to stop IntelliJ showing such warning messages?

My IDE version is IntelliJ IDEA 2019.3.3 (Ultimate Edition)

enter image description here

like image 755
theedchen Avatar asked Oct 26 '25 03:10

theedchen


1 Answers

I solved it after installed the Lombok plugin for my IntelliJ.

Here is how I did:

  1. Go to File > Settings > Plugins .
  2. Then search "Lombok" and install the plugin.
  3. Restart the IntelliJ and the warning message disappeared.

Thanks for @Barracuda and @f1sh propmpt answer !!

like image 100
theedchen Avatar answered Oct 28 '25 16:10

theedchen