[java] Can't compile project when I'm using Lombok under IntelliJ IDEA

I'm trying to use Lombok in my project that I'm developing using IntelliJ IDEA 11.

I've installed 3rd-party plugin for IDEA and it seems working fine because IDEA sees all autogenerated methods/fields.

So I have a class that uses Slf4j. I annotated it like this

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class TestClass
{
    public TestClass()
    {
        log.info("Hello!");
    }
}

But when I build my project compiler spits: cannot find symbol variable log.

Could you please tell me what I'm missing here?

Update: It turned out it's RequestFactory annotation process that fails.

input files: {com.zasutki.courierApp.server.TestServlet, com.mine.courierApp.server.model.DatastoreObject}

annotations: [javax.inject.Singleton, javax.inject.Inject, lombok.Getter, lombok.Setter, com.googlecode.objectify.annotation.Id, com.googlecode.objectify.annotation.OnSave]

Processor com.google.web.bindery.requestfactory.apt.RfValidator matches [lombok.Getter, com.googlecode.objectify.annotation.Id, javax.inject.Inject, lombok.Setter, com.googlecode.objectify.annotation.OnSave, javax.inject.Singleton] and returns false.

cannot find symbol variable log

Any ideas on workarounds?

Update2: Perhaps it's not something readers want to hear but I ended up switching to Scala.

This question is related to java intellij-idea lombok

The answer is


Examples related to java

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How much should a function trust another function How to implement a simple scenario the OO way Two constructors How do I get some variable from another class in Java? this in equals method How to split a string in two and store it in a field How to do perspective fixing? String index out of range: 4 My eclipse won't open, i download the bundle pack it keeps saying error log

Examples related to intellij-idea

IntelliJ: Error:java: error: release version 5 not supported Has been compiled by a more recent version of the Java Runtime (class file version 57.0) Error: Java: invalid target release: 11 - IntelliJ IDEA IntelliJ can't recognize JavaFX 11 with OpenJDK 11 Error: JavaFX runtime components are missing, and are required to run this application with JDK 11 ERROR Source option 1.5 is no longer supported. Use 1.6 or later Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6 How to configure "Shorten command line" method for whole project in IntelliJ intellij idea - Error: java: invalid source release 1.9 Failed to resolve: com.google.android.gms:play-services in IntelliJ Idea with gradle

Examples related to lombok

Adding Lombok plugin to IntelliJ project how to Call super constructor in Lombok Lombok annotations do not compile under Intellij idea how to configure lombok in eclipse luna Lombok added but getters and setters not recognized in Intellij IDEA Building with Lombok's @Slf4j and Intellij: Cannot find symbol log Lombok is not generating getter and setter Can't compile project when I'm using Lombok under IntelliJ IDEA Omitting one Setter/Getter in Lombok Is it safe to use Project Lombok?