'Variable might not have been initialized when I'm using @RequiredArgsConstructor

I'm learning about Lombok and I have this error: Variable productRespository might not have been initialized. But I have the @RequiredArgsConstructor. And I'm using Intellij idea. So why do I need to create a constructor if I'm using this annotation? Thank you!

import lombok.RequiredArgsConstructor;

    @RequiredArgsConstructor

    @Service
    public class ProductService {

        private final ProductRespository productRespository;

        ...
    }


Solution 1:[1]

You need to install lombok plugin for idea if it is not installed yet.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Merve Cingoz