nagendra547
nagendra547

Reputation: 6302

Eclipse displaying compilation error messages while using lombok API

I am using lombok API in my codebase to generate getter and setter functionality internally for DTO. Here is one example.

import lombok.Data;

@Data
public class TemplateDTO {
    private String templateId;

    private String templateName;

}

The issue is while using the get/set methods of TemplateDTO in my codebase eclipse is showing me error messages.

However maven install is working fine (if I run via the command line).

Is there anyway I can disable error messages in eclipse or is there anyway I can resolve getter and setter code?

I am using Eclipse Neon.2 Release (4.6.2) in OSX.

Upvotes: 3

Views: 2223

Answers (1)

nagendra547
nagendra547

Reputation: 6302

I will answer this question myself. Thanks to lukjar and @MrSimpleMind response.

Just append following lines in eclipse.ini.

Basically add lombok.jar in your javaagent and Xbootclasspath arguments.

-Xbootclasspath/a:/Users/test/lombok/lombok.jar
-javaagent:/Users/test/lombok/lombok.jar

After this

  1. restart eclipse
  2. Run maven clean install
  3. Refresh eclipse workspace

It's good to go now.

Upvotes: 4

Related Questions