Lombok IntelliJ IDEA Plugin: Use of var is disabled by default

不想你离开。 提交于 2019-12-11 08:48:51

问题


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>

回答1:


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.



来源:https://stackoverflow.com/questions/47122653/lombok-intellij-idea-plugin-use-of-var-is-disabled-by-default

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!