1

I'm using the Lombok Plugin for IntelliJ IDEA. When try to run Java code using the var keyword, I get the following error:

Use of var is disabled by default. Please add 'lombok.var.flagUsage = ALLOW' to 'lombok.config' if you want to enable is.

How do you do that in IntelliJ IDEA? I created the lombok.config in the project root and pasted lombok.var.flagUsage = ALLOW but it didn't fix it. val is working but not var. I can't seem to find clear instructions on enabling var.

My Lombok maven dependency is:

<dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
    <version>1.16.18</version>
    <scope>provided</scope>
</dependency>
BullyWiiPlaza
  • 17,329
  • 10
  • 113
  • 185
  • You may need to recompile everything in order to observe the effect. – maaartinus Nov 05 '17 at 22:39
  • @maaartinus: Yeah, that was it. Thank you. Pretty stupid I forgot about that. – BullyWiiPlaza Nov 06 '17 at 11:58
  • Live and programming would be too simple if we never forget such stupid things. Please either delete your question or I'll convert my comment into an answer. It may be useful for someone or not (given the huge number of questions). I don't care. – maaartinus Nov 06 '17 at 12:03
  • I believe it could be useful eventually so please post an answer and that's going to be it. – BullyWiiPlaza Nov 06 '17 at 12:05

1 Answers1

2

You may need to recompile everything in order to observe the effect.

Actually, any change of any lombok.config anywhere should trigger a recompilation of all classes in the subtree. This is not the case as such changes are rare and don't warrant the probably non-trivial amount of work.

maaartinus
  • 44,714
  • 32
  • 161
  • 320