Search code examples
javavalue-objectsauto-value

Problems compiling AutoValue library example project


I just discovered google's AutoValue library, which seems great. I'm trying to compile the example project which I downloaded from here

But the project doesn't compile. The compiler complains about the AutoValue_ constructor symbol not being recognized. enter image description here

Can someone explain what I am doing wrong?

I am using auto-value-1.3.jar

Thanks


Solution

  • IntelliJ does not enable annotation processors by default.

    You can follow the official guide. You need to go to the Annotation Processors page and click + to create a new profile. Then you have to associate your module with this profile. In the end you only need to enable annotation processing for this profile and everything should work.

    The IntelliJ editor might not find the generated class files though and still display the name red. But it should not affect the build.