Could not compile project in Intellij Idea 13 EAP/12.1.5 due to Lombok usages - intellij-idea

While trying Intellij Idea 13 EAP ( which I'm aware is not stable ) I could not compile/run a working project because of the following warning:
java: lombok.javac.apt.Processor could not be initialized. Lombok will not run during this compilation: java.lang.ClassCastException: com.sun.tools.javac.processing.JavacProcessingEnvironment cannot be cast to com.sun.tools.javac.processing.JavacProcessingEnvironment
at lombok.javac.apt.Processor.init(Processor.java:84)
at lombok.core.AnnotationProcessor$JavacDescriptor.want(AnnotationProcessor.java:89)
at lombok.core.AnnotationProcessor.init(AnnotationProcessor.java:143)
It's working very well with Intellij Idea 12, but I need to run on 13 because of an another issue fixed only in 13 (IDEA-104616)
This error comes up:
com.sun.tools.javac.processing.JavacProcessingEnvironment cannot be cast to com.sun.tools.javac.processing.JavacProcessingEnvironment
Update:
Created JetBrains issue: IDEA-114130

It is an Intellij IDEA issue: IDEA-114130
Fixed in build 132.474
Note: Reproducible in Intellij IDEA 12.1.5; avoid upgrade (in case of Lombok use) !
UPDATE:
FIxed version is publicly released.

Related

JOOQ 3.17.1 appears to be generating source that won't work with Java 11

After upgrading to jooq 3.17.1 I get the following error:
Error:
/home/runner/work/waste-coordinator/waste-coordinator/webapp/target/generated-sources/jooq/com/myapp/portal/backend/jooq/tables/LoadView.java:[521,84]
text blocks are not supported in -source 11 Error: (use -source 15
or higher to enable text blocks)
It appears to me that it is generating source that is not compatible with JDK11. Is there a flag in the generator somewhere that can make it generate JDK 11 compatible code?
Edit: now I am getting the following compile error
[ERROR] COMPILATION ERROR : [INFO]
------------------------------------------------------------- [ERROR] /usr/local/code/sferion/WasteCoordinator/data/src/main/java/com/wastecoordinator/data/JOOQGenerator.java:[4,24]
cannot access org.jooq.codegen.GenerationTool bad class file:
/Users/benstpierre/.m2/repository/org/jooq/jooq-codegen/3.17.1/jooq-codegen-3.17.1.jar(/org/jooq/codegen/GenerationTool.class)
class file has wrong version 61.0, should be 55.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
Is jooq 3.17 not compatible with JDK 11?
You can download the right distribution to work with JDK 11 from here if you're licensed:
https://www.jooq.org/download/versions
Note that starting from jOOQ 3.17, the jOOQ Open Source Edition increased the baseline JDK version to Java 17, see:
https://github.com/jOOQ/jOOQ/issues/12430
https://blog.jooq.org/3-17-0-release-with-computed-columns-audit-columns-pattern-matching-reactive-transactions-and-kotlin-coroutine-support/
jOOQ is a bit early here, given that Spring will increase their own baseline only later in 2022:
https://spring.io/blog/2021/09/02/a-java-17-and-jakarta-ee-9-baseline-for-spring-framework-6
But jOOQ will continue to provide paid support for older JDKs for quite a while, still. At the same time, jOOQ 3.14 - 3.16 will receive patches for another while, too.

Problems in IntelliJ since version 2022.1 / java.lang.NoClassDefFoundError

As of today, when I try to run some of my programs in IntelliJ today, this message was shown:
Executing pre-compile tasks...
Loading Ant configuration...
Running Ant tasks...
Running 'before' tasks
Checking sources
Finished, saving caches…
Module 'Listen' production: java.lang.NoClassDefFoundError: com/intellij/DynamicBundle
Executing post-compile tasks...
Loading Ant configuration...
Running Ant tasks...
Synchronizing output directories...
13.04.22, 14:54 - Build completed with 1 error and 0 warnings in 4 sec, 39 ms
This line is printed in red: Module 'Listen' production: java.lang.NoClassDefFoundError: com/intellij/DynamicBundle
I don't really have too much of an idea where I should look for the problem.
It seems to not have anything to do with the project itself. I already created a new Project and created a Hello World-program, which resulted in the same error.
Remarkably, yesterday my IntelliJ IDEA version was updated to version 2022.1.
Runtime version: 11.0.14.1+1-b2043.25 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
I have no idea either whether it has anything to do with the new version either.
I maintain another Project, which uses Scala language. That one is messed up even more:
Cannot process toolwindow sbt
java.lang.AbstractMethodError: Missing implementation of resolved method 'abstract com.intellij.openapi.externalSystem.settings.AbstractExternalSystemSettings getSettings(com.intellij.openapi.project.Project)' of abstract class com.intellij.openapi.externalSystem.service.task.ui.AbstractExternalSystemToolWindowFactory.
at com.intellij.openapi.externalSystem.service.task.ui.AbstractExternalSystemToolWindowFactory.shouldBeAvailable(AbstractExternalSystemToolWindowFactory.java:35)
at com.intellij.toolWindow.ToolWindowSetInitializerKt.beanToTask(ToolWindowSetInitializer.kt:262)
at com.intellij.toolWindow.ToolWindowSetInitializerKt.beanToTask(ToolWindowSetInitializer.kt:248)
at com.intellij.toolWindow.ToolWindowSetInitializerKt.access$beanToTask(ToolWindowSetInitializer.kt:1)
at com.intellij.toolWindow.ToolWindowSetInitializerKt$computeToolWindowBeans$1.accept(ToolWindowSetInitializer.kt:278)
at com.intellij.toolWindow.ToolWindowSetInitializerKt$computeToolWindowBeans$1.accept(ToolWindowSetInitializer.kt)
at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processWithPluginDescriptor(ExtensionPointImpl.java:301)
at com.intellij.toolWindow.ToolWindowSetInitializerKt.computeToolWindowBeans(ToolWindowSetInitializer.kt:274)
at com.intellij.toolWindow.ToolWindowSetInitializer$1.get(ToolWindowSetInitializer.kt:101)
at com.intellij.toolWindow.ToolWindowSetInitializer$1.get(ToolWindowSetInitializer.kt:83)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
at java.base/java.lang.Thread.run(Thread.java:829)
Any advice?
Best
Stapelüberläufer
I had the same problem after upgrading to Intellij 2022.1
For me, the fix came from Gen's answer. I also had an old Scala plugin, and just removed it as I'm not using it anymore.
If you are looking to upgrade it, go to File -> Settings -> Plugins. From there just hit Upgrade for the plugins you want. After that restart the IDE.
I found that Scala plugin was not updated and updating it to at least version 2022.1.13 fixed it for me.
I upgraded to Intellij 2022.1 and encountered this issue when trying to sync the old gradles projects that used to work for me :
Caused by: java.lang.NoClassDefFoundError: org/gradle/internal/impldep/com/google/common/collect/Lists
Cleaning the caches folder's content (Gradle_HOME/caches) resolved this issue for me
Make sure to also check that the SDK is correctly configured for your project (Java 17 by default) and the Gradle home is well specified in the Settings>Gradle section.
For info, I'm using Java 8 and Gradle 5.5.1 (yes I know :))
Just upgrade the Scala Plugin and its done!
visiting
scala plugin's page
and install it from there worked for me on ultimate version 2022.2.3

Can't start IntelliJ IDEA after upgrade

I've upgraded to the latest version of IntelliJ IDEA and now it doesn't start. Stacktrace:
java.lang.IllegalAccessError: tried to access method com.intellij.openapi.vfs.newvfs.persistent.FSRecords.connect()V from class com.zeroturnaround.optimizer.plugin.functions.platform.caches.CacheApi
at com.zeroturnaround.optimizer.plugin.functions.platform.caches.CacheApi.cachesLastCleanedVFS(CacheApi.java:34)
at com.zeroturnaround.optimizer.plugin.functions.platform.caches.CacheApi.cacheLastCleaned(CacheApi.java:17)
at com.zeroturnaround.optimizer.plugin.activities.CleanCacheActivity.doInitialize(CleanCacheActivity.java:22)
at com.zeroturnaround.optimizer.plugin.activities.AbstractActivity.initialize(AbstractActivity.java:29)
at com.zeroturnaround.optimizer.plugin.state.model.ApplicationStateInitializer.initialize(ApplicationStateInitializer.java:20)
at com.zeroturnaround.optimizer.plugin.Bootstrap.initialize(Bootstrap.java:62)
at com.zeroturnaround.optimizer.plugin.Bootstrap.access$000(Bootstrap.java:22)
at com.zeroturnaround.optimizer.plugin.Bootstrap$1.run(Bootstrap.java:37)
at java.lang.Thread.run(Thread.java:745)
The issue is caused by Optimizer Zeroturnaround plugin. To solve the issue, please remove the plugin manually from IDE plugins folder.

IntelliJ: Kotlin error causes mouse flicker and errors in code

I'm using IntelliJ 15 with Kotlin beta-1038, and I'm getting this error at the bottom of eclipse.
Internal Error occurred while analyzing this expression:
java.util.ServiceConfigurationError: org.jetbrains.kotlin.resolve.ExternalOverridabilityCondition: Provider org.jetbrains.kotlin.load.java.ErasedOverridabilityCondition not found
at java.util.ServiceLoader.fail(ServiceLoader.java:239)
at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:372)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
at kotlin.CollectionsKt___CollectionsKt.toCollection(_Collections.kt:949)
at kotlin.CollectionsKt.toCollection(Unknown Source)
at kotlin.CollectionsKt___CollectionsKt.toArrayList(_Collections.kt:942)
at kotlin.CollectionsKt.toArrayList(Unknown Source)
at kotlin.CollectionsKt___CollectionsKt.toList(_Collections.kt:973)
at kotlin.CollectionsKt.toList(Unknown Source)
at org.jetbrains.kotlin.resolve.OverridingUtil.<clinit>(OverridingUtil.java:41)
at org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedClassDescriptor$DeserializedClassMemberScope.generateFakeOverrides(DeserializedClassDescriptor.kt:216)
at org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedClassDescriptor$DeserializedClassMemberScope.computeNonDeclaredFunctions(DeserializedClassDescriptor.kt:202)
at org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedMemberScope.computeFunctions(DeserializedMemberScope.kt:77)
at org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedMemberScope.access$computeFunctions(DeserializedMemberScope.kt:32)
at org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedMemberScope$functions$1.invoke(DeserializedMemberScope.kt:50)
at org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedMemberScope$functions$1.invoke(DeserializedMemberScope.kt:32)
at org.jetbrains.kotlin.storage.LockBasedStorageManager$MapBasedMemoizedFunction.invoke(LockBasedStorageManager.java:389)
at org.j...
Every Kotlin file I touch becomes full of errors and my mouse will flicker and I'll lag when I hover over any of the code. I also don't have intellisense.
However, I can compile and run the project and my changes in the kotlin files will work.
IntelliJ IDEA 15.0.4 bundles Kotlin 1.0 release. You broke your Kotlin installation because you followed the incorrect advice given to you at How to downgrade Kotlin in Intellij 15. To fix your installation, you need to reinstall IntelliJ IDEA from the original installer.

InteliJ SBT auto import of scala project gives: Binary incompatibility in plugins detected

I was working happily in InteliJ with scala 2.10 and Java 1.7 - and am in the process of trying to upgrade to scala 2.11 and Java 1.8
I'm on Ubuntu 14 -- and javac shows
update-alternatives --config javac
There are 2 choices for the alternative javac (providing /usr/bin/javac).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-8-oracle/bin/javac 4 auto mode
1 /usr/lib/jvm/java-7-oracle/bin/javac 3 manual mode
* 2 /usr/lib/jvm/java-8-oracle/bin/javac 4 manual mode
As I have both java 7 and 8 installed.
I'm trying to import a Play 2.3 project (using the IntelJ SBT auto import) and am getting the error
Error while importing SBT project: ... at xsbt.boot.Boot$.main(Boot.scala:20) at xsbt.boot.Boot.main(Boot.scala) [error] sbt.IncompatiblePluginsException: Binary incompatibility in plugins detected. [error] Note that conflicts were resolved for some dependencies: [error] com.github.mpeltonen:sbt-idea [error] commons-io:commons-io [error] org.apache.commons:commons-lang3
......
I'm not sure how to progress investigating this; but my thinking is
From - Sbt plugin binary incompatibility - it could relate to the version on SBT that inteliJ is using?
Another thought was; Is the InteliJ Scala Plugin specific to a Java version (7 vs 8?) If so - how do I make sure InteliJ gets the correct one? I tried re-installing the plugin; but that didn't change anything.
Thanks
Brent
Ah; I just had to update Project Settings to use 1.8!