Cursor and VS Code - Lombok problems

520 views
Skip to first unread message

Alexander Moyer

unread,
Oct 18, 2024, 8:42:26 PM10/18/24
to Project Lombok
Hello,

Lombok isn't working in my IDE. I've tried about 20 suggested pom.xml configs for Lombok from chatgpt to no avail. The app is literally a class Wtf.java w/ @Data and name, description, and a WtfService.java with a method to add hello world to the name and description. The project is directly from start.spring.io otherwise, and errors about no getters or setters. I'm using cursor/vs code with the lombok extensions.
e.g., straight from start.spring.io w/ my additions:

```
package com.example.demo;

import lombok.Data;

@Data
public class Wtf {
    private String name;
    private String description;
}
```
```
package com.example.demo;

import org.springframework.stereotype.Service;

@Service
public class WtfService {
    public Wtf getHello() {
        Wtf wtf = new Wtf();
        wtf.setName("Hello");
        wtf.setDescription("World");
        return wtf;
    }
}

```

```
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/chloe/java/demo/src/main/java/com/example/demo/WtfService.java:[9,12] cannot find symbol
  symbol:   method setName(java.lang.String)
  location: variable wtf of type com.example.demo.Wtf
[ERROR] /C:/Users/chloe/java/demo/src/main/java/com/example/demo/WtfService.java:[10,12] cannot find symbol
  symbol:   method setDescription(java.lang.String)
  location: variable wtf of type com.example.demo.Wtf
```

Josiah Gumerman

unread,
Oct 22, 2024, 3:54:17 PM10/22/24
to Project Lombok
Did you try what's in the documentation for adding this?

https://projectlombok.org/setup/gradle

What build tool are you using?  What IDE?

Josiah

Reply all
Reply to author
Forward
0 new messages