Lombok not working with IntelliJ 2020.3 Community Edition - java

I worked with Lombok without any problems until Today, when my Intellij was automatically updated to the latest version 2020.3 30th, November build. After that, any Lombok annotations is not recognised anymore.
My Java project still build from command line with Maven but annotations are completely ignored in the project and cannot run any unit tests manually.
Things I tried so far:
Reinstalled the Lombok plugin
Restarted Intellij
Restarted the laptop
Invalidated the cache
Re-cloned the project from github
Checked that the annotation processor is enabled
Nothing worked. What could have happened? Any idea on what I can try to do?

To summarize go to IntelliJ Preferences (Cmd + ,)
Preferences -> Build, Execution, Deployment -> Compiler
search for this option:
User-local build process VM options (overrides Shared options):
and add this value:
-Djps.track.ap.dependencies=false

A work around is here, until they fix the actual problem:
https://youtrack.jetbrains.com/issue/IDEA-250718#focus=Comments-27-4418347.0-0
(see screenshoot for IJ fix)

I was using Lombok fine with 2020.2 and plugin, but in 2020.3.1 it should be (and it is) included
...but I had compilation errors like Cannot resolve symbol 'log' (when using #Slf4j)
I solved the problem deleting .idea from project and opened it again...
edit: it happened to me again today with new checkout (we do not have .idea in Git) and I had similar problem. Not sure if that was a fix, but I checked the plugin (it is not on screenshot above), it started working after, but I built it from cmd (Maven) and tried few other things, so I'm not sure what is a real fix

My problem was related to my lombok version
Before upgrade my IntelliJ to 2020.03 my lombok version was 1.18.10 and the lombok plugin 0.32-EAP
After upgrade my lombok dependency to 1.18.16 it start work again without any issues. Looks like the plugin is not bundled yet in the community edition.
I don't if is necessary, but my first action was to uninstall the plugin when I read the README on Lombok Plugin repo

Please check in: Lombok plugin settings you didn't disable it unintentionally.

Seems like lombok is not bundled in Community edition of 2020.3 version. Fix is expected in 2020.3.1 version.
From Lombok plugin GitHub issue
Sorry guys, I have to confirm, it was forgotten to add it properly
into the last community build. See bug on Jetbrains Yourtrack:
https://youtrack.jetbrains.com/issue/IDEA-257311
The Ultimate 2020.3 version contains lombok plugin as expected per
default.
lombok plugin should be included in both IntelliJ distribution
(Ultimate and Community) starting with 2020.3 release. Something get
wrong, we are working to fix it.
Fix is now planned for IntelliJ Community release 2020.3.1
Update
2020.3.1 Community is released and contains lombok plugin by default now

I managed to make it work on a gradle project (Intellij 2020.3.2)
by using exactly this in build.gradle :
annotationProcessor 'org.projectlombok:lombok:1.18.18'
implementation 'org.projectlombok:lombok:1.18.18'
I think important point is to declare it as "annotationProcessor" to include it in the gradle build.
I did not even have to mess around with "User-local build process VM options" and even "Enable Annotation Processing" is not ticked in Intellij Settings.
So I guess that gradle is taking care of the Lombok generation, and not IDEA.
but at least it finally works after hours lost trying to fix IntelliJ.

This is the problem with lombok, whenever IntelliJ provides upgrade lombok starts crying. Same happened with IntelliJ 2020.2
Now there are 2 solutions
Wait till the developers of lombok provide upgrade compatible with IntelliJ 2020.3
Downgrade IntelliJ to previous working version. For me IntelliJ 2020.2 worked perfectly fine.

Installing Lombok plugin and enabling the annotation processor should do the needful. If still issue persists then i think you should report a bug and see what they reply.

Related

Update IntelliJ default Gradle version

When starting a new project I get the message unsupported JDK. Using Gradle 7.1. I want to update that default Gradle to 7.3-rc-1.
However, I just can't seem to find where to do this outside of a specific project. I am not sure where IntelliJ obtains it's Gradle version, and it has auto-updated in the past.
Sure I could update it afterwards, but as IntelliJ seems to break on trying to create folders and doesn't go back to do it once Gradle is updated. It would save a lot of headache for IntelliJ and myself to update or force it to use the version I want before the project creation.
https://i.stack.imgur.com/TLyxF.png
IntelliJ bundles version of Gradle much like it bundles a version of the JDK. In order to upgrade the bundled version of Gradle, you must update Intellij. However, there is no guarantee that an updated version of IntelliJ will come with an updated version of Gradle.

Why is IntelliJ IDEA unable to determine java version?

I'm rather new to IntelliJ IDEA and Grails in general. I just started a new Project, selected my project JDK (11.0.1) and Gradle distribution (4.10.2). Whenever I try to run the project, I get this error:
Error initializing classpath: Could not determine java version from
'11.0.1'. java.lang.IllegalArgumentException: Could not determine java
version from '11.0.1'. at
org.gradle.api.JavaVersion.toVersion(JavaVersion.java:68) at
org.gradle.api.JavaVersion.current(JavaVersion.java:78) at
org.gradle.internal.jvm.UnsupportedJavaRuntimeException.assertUsingVersion(UnsupportedJavaRuntimeException.java:29)
at
org.gradle.tooling.internal.consumer.ConnectorServices.checkJavaVersion(ConnectorServices.java:66)
at
org.gradle.tooling.internal.consumer.ConnectorServices.close(ConnectorServices.java:53)
at
org.gradle.tooling.internal.consumer.DefaultGradleConnector.close(DefaultGradleConnector.java:57)
at
org.grails.cli.gradle.cache.CachedGradleOperation.call(CachedGradleOperation.groovy:78)
at
org.grails.cli.GrailsCli.populateContextLoader(GrailsCli.groovy:525)
at org.grails.cli.GrailsCli.initializeProfile(GrailsCli.groovy:508)
at
org.grails.cli.GrailsCli.initializeApplication(GrailsCli.groovy:306)
at org.grails.cli.GrailsCli.execute(GrailsCli.groovy:269) at
org.grails.cli.GrailsCli.main(GrailsCli.groovy:159)
All other discussions of the problem I found suggested changing the Gradle distribution, which I already did. I would be so happy if anybody could help me out here.
Cheers!
May be your java configuration is not correct. If not correct follow this steps.
Goto File-> Project Structure.
Change SDK
Or gradle version is not matching jdk 11 then skip this answer.
Besides the issue with Gradle above, if you're trying to run a Grails project I don't think you can do that with JDK higher than version 8.
Even the latest Grails (3.3.8 as of this writing) is still based on SpringBoot 1.5 which does not support newer JDK, I don't know if there's a special trick to make it work.
I had to delete the .gradle directory and restart Intellij.

Not able to install M2eclipse plugin in NEON Eclipse

I have installed Eclipse Neon Milestone 4, Java 8, and Apache Maven 3.3.3 on my windows system. I am trying to install plugin :: M2E - Maven Integration for Eclipse 1.6.2 in eclipse. I am getting error -
Cannot complete the request. See the error log for details.
"m2e - Maven Integration for Eclipse (includes Incubating components)" will be ignored because a newer version is already installed.
But When I look in "Installation detail" I can't see Maven plugin there. Also no Maven menu option is coming when I am right clicking the project.
Please help to proceed.
I just ran into this problem too. I'm using the same version of Eclipse, etc. It turns out that the "fix" was kind of subtle. When you go an install new software under the help option using "http://download.eclipse.org/technology/m2e/releases", then you select the maven option. On the next screen they say here's what your downloading...
I had to select the two items by highlighting them then press next and agree to the licenses for m2eclipse to install correctly. The first time when it didn't work I thought, okay great that's what I need, and then nothing happened. Hopefully that helps, I realize you're getting this answer about 10 months after you asked for help.

Golang plugin on Intellij

I want to use Intellij 13.1.6 as my go app IDE, but there are some problem I can't sovle yet.
The default version of go support plugin installed on Intellij is 0.9.15, but in this version, there are some bugs so that I can build project successfully.
So I try to build the go-plugin jar by myself follow this article:
https://content.pivotal.io/blog/setting-up-the-google-go-plugin-with-intellij-idea-13-on-os-x-10-8-5
But when I click Prepare Plugin Module 'google-go-language' For Deployment, it shows errors cause some method can't be found. As the following figure
I think the problem is the version of my Intellij lack of some lib so that I can't build go-plugin jar successfully. How do I fix this?
Appreciate any replies.
Intellij Version: 13.1.6
JDK Version: 1.7
Go-plugin on GitHub: the latest commit on master branch (0261ffa)
The latest version of the Go plugin code requires IntelliJ IDEA 14.

Intellij can't initialize plugins

OS: 64x Windows 7
IDE: IntelliJ IDEA 12.1.4
After activating the plugins log4j and IdeaSpring, IntelliJ wants to restart itself. While restarting IntelliJ, there are 2 messages which prompt that either log4j and IdeaSpring couldn't be initialized.
How can I set up my IntelliJ that those 2 plugins work?
Messages:
Plugin IdeaSpring failed to initialize and will be disabled:
Could not load API connector for IntelliJ IDEA build #IC-129.713
Please restart IntelliJ IDEA.
and
Plugin IdeaSpring failed to initialize and will be disabled:
com.intellij.javaee.ExternalResourceManager.addStdResource(Ljava/lang/String;Ljava/langString;Ljava/lang/Class;)V
Please restart IntelliJ IDEA.
IdeaSpring is a third-party plugin which wasn't adapted to the API changes in IDEA 9 (note that it hasn't been updated since 2006) Please report the problem to the plugin vendor (http://www.yanaware.com/)
BTW, Intellij Idea has its own Spring support - why do you need using third-party plugins?
The answer to the question is: you shouldn't. The plugin you're trying to install IdeaSpring) is from 2006. You should use the Ultimate Version of IntelliJ, which has excellent Spring support. The free version doesn't.
The same for the other plugin; it's also very old, and probably doesn't work anymore. I'm not sure if you need that one, since IntelliJ also has support for most of the XML log4j provides.
I'd say: try the Ultimate version, and either buy it or try to get a free version if you're working on a Open Source project.
Alternatively, if you can't spare the money, you could have a look at SpringSource Tool Suite, which is pretty decent too, but at least it doesn't cost money, and it does have support for Spring.

Categories