
Lombok @Getter/@Setter Not Working in Eclipse or STS? Fix in 3 Steps by Keval Chheda
Introduction If you are a Java or Spring Boot developer, you have probably faced this situation. You add Lombok annotations like: @Getter @Setter @Data But suddenly your IDE shows errors like: The method getName() is undefined for the type User or Cannot find symbol: method getId() Even though your project compiles successfully. This is one of the most common Lombok issues in Eclipse / Spring Tool Suite (STS). In this article, we'll understand: Why Lombok stops working The most common causes How to fix it in 3 simple steps The Problem Consider this class: import lombok.Getter; import lombok.Setter; @Getter @Setter public class User { private String name; private int age; } Now in another class: User user = new User(); user.setName("John"); System.out.println(user.getName()); But Eclipse shows an error: The method getName() is undefined for the type User Why? Because Eclipse is not processing Lombok annotations. Why This Happens Lombok works using Annotation Processing. During compilati
Continue reading on Dev.to
Opens in a new tab



