Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running under IDEA 2020.1 + Java 8 runtime #13

Closed
putypuruty opened this issue Apr 14, 2020 · 12 comments
Closed

Error running under IDEA 2020.1 + Java 8 runtime #13

putypuruty opened this issue Apr 14, 2020 · 12 comments

Comments

@putypuruty
Copy link

Hello,

I tried using the SpotBugs plugin under IDEA 2020.1 but I get an exception and the only way to have a working IDE again is to uninstall/disable the plugin.

As you can see in the stacktrace, the problem is that the plugin seems to be compiled with Java 11.

If I run IDEA with a Java 11 runtime, the plugin works just fine but I don't think that this should be required, it should also work with a Java 8 runtime.

2020-04-14 09:04:36,143 [ 6836] ERROR - m.PlatformProjectOpenProcessor - Fatal error initializing plugin org.jetbrains.plugins.spotbugs com.intellij.ide.plugins.StartupAbortedException: Fatal error initializing plugin org.jetbrains.plugins.spotbugs at com.intellij.serviceContainer.ComponentManagerImplKt.handleComponentError(ComponentManagerImpl.kt:952) at com.intellij.serviceContainer.ComponentManagerImpl.handleInitComponentError(ComponentManagerImpl.kt:333) at com.intellij.serviceContainer.ComponentManagerImpl.registerComponents(ComponentManagerImpl.kt:198) at com.intellij.serviceContainer.ComponentManagerImpl.registerComponents(ComponentManagerImpl.kt:157) at com.intellij.openapi.project.ProjectLoadHelper$Companion.registerComponents(projectLoader.kt:29) at com.intellij.openapi.project.ProjectLoadHelper.registerComponents(projectLoader.kt) at com.intellij.openapi.project.impl.ProjectManagerImpl.initProject(ProjectManagerImpl.java:318) at com.intellij.platform.PlatformProjectOpenProcessorKt.convertAndLoadProject(PlatformProjectOpenProcessor.kt:413) at com.intellij.platform.PlatformProjectOpenProcessorKt.prepareProject(PlatformProjectOpenProcessor.kt:308) at com.intellij.platform.PlatformProjectOpenProcessorKt.access$prepareProject(PlatformProjectOpenProcessor.kt:1) at com.intellij.platform.PlatformProjectOpenProcessor$Companion$openExistingProject$$inlined$runInAutoSaveDisabledMode$lambda$1.invoke(PlatformProjectOpenProcessor.kt:181) at com.intellij.platform.PlatformProjectOpenProcessor$Companion$openExistingProject$$inlined$runInAutoSaveDisabledMode$lambda$1.invoke(PlatformProjectOpenProcessor.kt:58) at com.intellij.platform.ProjectUiFrameAllocator$run$1$$special$$inlined$createModalTask$1.run(progress.kt:37) at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:930) at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:480) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$new$0(ProgressRunner.java:77) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$null$3(ProgressRunner.java:233) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:164) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:625) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:570) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:151) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:233) at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: com.intellij.diagnostic.PluginException: While loading class org.jetbrains.plugins.spotbugs.core.FindBugsCompileAfterHook: org/jetbrains/plugins/spotbugs/core/FindBugsCompileAfterHook has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 [Plugin: org.jetbrains.plugins.spotbugs] [Plugin: org.jetbrains.plugins.spotbugs] ... 27 more Caused by: com.intellij.diagnostic.PluginException: While loading class org.jetbrains.plugins.spotbugs.core.FindBugsCompileAfterHook: org/jetbrains/plugins/spotbugs/core/FindBugsCompileAfterHook has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 [Plugin: org.jetbrains.plugins.spotbugs] at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:262) at com.intellij.ide.plugins.cl.PluginClassLoader.tryLoadingClass(PluginClassLoader.java:205) at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:113) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at com.intellij.serviceContainer.ComponentManagerImpl.registerComponent(ComponentManagerImpl.kt:288) at com.intellij.serviceContainer.ComponentManagerImpl.registerComponents(ComponentManagerImpl.kt:194) ... 24 more Caused by: java.lang.UnsupportedClassVersionError: org/jetbrains/plugins/spotbugs/core/FindBugsCompileAfterHook has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:763) at java.lang.ClassLoader.defineClass(ClassLoader.java:642) at com.intellij.util.lang.UrlClassLoader._defineClass(UrlClassLoader.java:380) at com.intellij.util.lang.UrlClassLoader.defineClass(UrlClassLoader.java:376) at com.intellij.util.lang.UrlClassLoader._findClass(UrlClassLoader.java:340) at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:259) ... 31 more 2020-04-14 09:04:36,146 [ 6839] ERROR - m.PlatformProjectOpenProcessor - IntelliJ IDEA 2020.1 Build #IU-201.6668.121 2020-04-14 09:04:36,146 [ 6839] ERROR - m.PlatformProjectOpenProcessor - JDK: 1.8.0_171; VM: Java HotSpot(TM) 64-Bit Server VM; Vendor: Oracle Corporation 2020-04-14 09:04:36,146 [ 6839] ERROR - m.PlatformProjectOpenProcessor - OS: Linux 2020-04-14 09:04:36,147 [ 6840] ERROR - m.PlatformProjectOpenProcessor - Plugin to blame: SpotBugs version: 1.1.0

@amaembo
Copy link
Collaborator

amaembo commented Apr 14, 2020

Why are you using IDEA on Java 8 runtime? It's bundled with Java 11 runtime by default.

@putypuruty
Copy link
Author

I've installed IDEA a long time ago without JBR and I'm just installing the updates as they come, I never got asked if I want to use JBR 11/was never "migrated" automatically to it.

I haven't seen anywhere that this plugin requires Java 11+ to run. Maybe it would be a good idea to explicitly mention it somewhere.

But as you also support IDEA 2019.3 which works with JBR 8, shouldn't the plugin work under Java 8, too? Just asking ;)

@amaembo
Copy link
Collaborator

amaembo commented Apr 15, 2020

@putypuruty default downloads for IDEA 2019.3 already bundle JBR 11. JBR 8 version is provided as a fallback in case of any problems. It's very likely that IDEA 2020.2 will not work on JDK 8 at all, so to me, it looks questionable to spend time supporting JDK 8 now, only for a few months.

Btw using non-bundled JDK you miss many UI-related fixes that are available in JBR. It's highly recommended to use bundled JBR, unless you have strong reasons to avoid it (e.g. it crashes on your particular system).

@putypuruty
Copy link
Author

Thank you for the clarifications! I see your point why it's no longer worth supporting a Java 8 version of the plugin ;)

I've meanwhile used the steps described here to install JBR 11 and erverything seems to work OK so far.

Thank you once again for your time!

@simonrob
Copy link

Just to add another viewpoint to this discussion - I'd like to use SpotBugs with Android Studio (which is based on IDEA), but even the very latest version (4.0) still uses Java 8. Changing the runtime just causes a different error (see below).

Could you consider supporting SpotBugs for Android Studio?

Error:Internal error: (java.lang.ClassNotFoundException) com.google.wireless.android.sdk.stats.IntellijIndexingStats$Index
java.lang.ClassNotFoundException: com.google.wireless.android.sdk.stats.IntellijIndexingStats$Index
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
	at com.intellij.util.indexing.counters.IndexCounters.<clinit>(IndexCounters.java:34)
	at com.intellij.util.indexing.impl.MapReduceIndex.<init>(MapReduceIndex.java:92)
	at com.intellij.util.indexing.impl.MapReduceIndex.<init>(MapReduceIndex.java:108)
	at org.jetbrains.jps.backwardRefs.index.CompilerReferenceIndex$CompilerMapReduceIndex.<init>(CompilerReferenceIndex.java:274)
	at org.jetbrains.jps.backwardRefs.index.CompilerReferenceIndex.<init>(CompilerReferenceIndex.java:110)
	at org.jetbrains.jps.backwardRefs.JavaCompilerBackwardReferenceIndex.<init>(JavaCompilerBackwardReferenceIndex.java:13)
	at org.jetbrains.jps.backwardRefs.JavaBackwardReferenceIndexWriter.initialize(JavaBackwardReferenceIndexWriter.java:80)
	at org.jetbrains.jps.incremental.java.JavaBuilder.buildStarted(JavaBuilder.java:152)
	at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:361)
	at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:178)
	at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:140)
	at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:297)
	at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:130)
	at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:232)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

@amaembo
Copy link
Collaborator

amaembo commented May 29, 2020

Oh, I see. And which IntelliJ IDEA version Android Studio is based on? Downgrading to Java 8 is probably easy, but downgrading from 2019.3 to a lower version would be harder as we already using some new APIs.

@simonrob
Copy link

According to the release announcement, Android Studio 4.0 has been updated with improvements from IntelliJ IDEA 2019.3 and 2019.3.3 releases. Whether this means it is based on 2019.3+ or just includes fixes is not 100% clear though.

Here's the about screen information in case that helps:

Android Studio 4.0
Build #AI-193.6911.18.40.6514223, built on May 20, 2020
Runtime version: 1.8.0_242-release-1644-b3-6222593 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

amaembo added a commit that referenced this issue Jun 4, 2020
@amaembo
Copy link
Collaborator

amaembo commented Jun 4, 2020

Java 1.8 should be supported since version 1.2.0. Please check

@simonrob
Copy link

simonrob commented Jun 4, 2020

Thanks for this. I've updated, and the plugin now installs and shows up in the IDE using the default runtime.

However, when trying to actually scan a project, I get the same error as reported in my earlier comment. Incidentally, the existing (deprecated) FindBugs plugin gives the same error.

Is there anything I can do to help figure out why this is happening?

@amaembo
Copy link
Collaborator

amaembo commented Jun 4, 2020

I get the same error as reported in my earlier comment

Sorry, I don't understand which comment exactly you are referring to. Please paste the new error stack trace (even if the message is the same line numbers could be different now). Thanks.

@amaembo
Copy link
Collaborator

amaembo commented Jun 4, 2020

Btw some workarounds are mentioned here spotbugs/spotbugs#931 (comment)

@simonrob
Copy link

simonrob commented Jun 4, 2020

Thanks! (Should have spotted that myself, sorry.)

There are lots of suggestions there that don't seem like they could be related (keystore; eclipse; runtime), but what does work is to disable Compile affected files before analyze as suggested in spotbugs/spotbugs#931 (comment).

If there's anything else I can do to help you figure out why compiling is fine normally but fails when initiated by SpotBugs I'm happy to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants