IntelliJ IDEA crash on startup (NoClassDefFoundError: Could not initialize class com.sun.jna.Native) - intellij-idea

Okay so I am using Windows 10, I am having issues starting up intelliJ IDEA as every time I run it, it throws the following error and crashes,
Internal error. Please refer to
https://jb.gg/ide/critical-startup-errors
com.intellij.ide.plugins.StartupAbortedException: Cannot start app
at com.intellij.idea.StartupUtil.lambda$start$15(StartupUtil.java:265)
at java.base/java.util.concurrent.CompletableFuture.uniExceptionally(CompletableFuture.java:990)
at java.base/java.util.concurrent.CompletableFuture$UniExceptionally.tryFire(CompletableFuture.java:974)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1773)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class
com.sun.jna.Native
at com.sun.jna.platform.win32.WinReg$HKEYByReference.(WinReg.java:52)
at com.sun.jna.platform.win32.WinReg$HKEYByReference.(WinReg.java:48)
at com.sun.jna.platform.win32.Advapi32Util.registryGetStringValue(Advapi32Util.java:736)
at com.sun.jna.platform.win32.Advapi32Util.registryGetStringValue(Advapi32Util.java:717)
at com.intellij.openapi.util.WinBuildVersionKt.getWinBuildNumberInternal(WinBuildVersion.kt:14)
at com.intellij.openapi.util.WinBuildVersionKt.access$getWinBuildNumberInternal(WinBuildVersion.kt:1)
at com.intellij.openapi.util.WinBuildVersionKt$getWinBuildNumber$1.invoke(WinBuildVersion.kt:33)
at com.intellij.openapi.util.WinBuildVersionKt$getWinBuildNumber$1.invoke(WinBuildVersion.kt)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at com.intellij.openapi.util.WinBuildVersionKt.getWinBuildNumber(WinBuildVersion.kt:33)
at com.intellij.openapi.util.SystemInfo.getWinBuildNumber(SystemInfo.java:123)
at com.intellij.openapi.wm.impl.customFrameDecorations.header.CustomHeader$CustomFrameTopBorder.calculateAffectsBorders(CustomHeader.kt:276)
at com.intellij.openapi.wm.impl.customFrameDecorations.header.CustomHeader$CustomFrameTopBorder.addNotify(CustomHeader.kt:346)
at com.intellij.openapi.wm.impl.customFrameDecorations.header.CustomHeader.addNotify(CustomHeader.kt:158)
at com.intellij.openapi.wm.impl.customFrameDecorations.header.DialogHeader.addNotify(DialogHeader.kt:59)
at java.desktop/java.awt.Container.addNotify(Container.java:2804)
at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4847)
at java.desktop/java.awt.Container.addNotify(Container.java:2804)
at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4847)
at java.desktop/java.awt.Container.addNotify(Container.java:2804)
at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4847)
at java.desktop/javax.swing.JRootPane.addNotify(JRootPane.java:729)
at java.desktop/java.awt.Container.addNotify(Container.java:2804)
at java.desktop/java.awt.Window.addNotify(Window.java:797)
at java.desktop/java.awt.Dialog.addNotify(Dialog.java:770)
at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.addNotify(DialogWrapperPeerImpl.java:641)
at java.desktop/java.awt.Window.pack(Window.java:835)
at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.pack(DialogWrapperPeerImpl.java:311)
at com.intellij.openapi.ui.DialogWrapper.pack(DialogWrapper.java:1432)
at com.intellij.ide.gdpr.AgreementUi.pack(AgreementUi.kt:254)
at com.intellij.ide.gdpr.Agreements.showEndUserAndDataSharingAgreements(Agreements.kt:19)
at com.intellij.idea.StartupUtil.lambda$showEuaIfNeeded$25(StartupUtil.java:607)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:779)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:730)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:724)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:749)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:393)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
----- Your JRE: 17.0.3+7-b469.32 amd64 (JetBrains s.r.o.) C:\Program Files\Jetbrains\IntelliJ IDEA\jbr
Has anyone encountered something like this? I've never seen this issue before so completely clueless, any help would be greatly appreciated.
Thanks a lot

When running the IntelliJ IDEA, a dll
C:\Users<user_name>\AppData\Local\JetBrains\IntelliJIdea2022.2\tmp\jnaxxxx.dll is extracted in IDEA's temp dir and executed.
In Windows, some security tools can restrict the folders where binaries (e.g. dll, ...) can be executed.
If you have security tools installed, ensure that all IDE, project, and IDE installation directories are added to the exclusions list.

Related

IntelliJ Idea mapstruct java: Internal error in the mapping processor:com.sun.tools.javac.jvm.ClassReader$BadClassFile: bad class file

Recently I started getting bad class file during build in IntelliJ IDEA 2021.2.2 and MapStruct version 1.4.2.Final. Maven build is running fine. Does anyone have a clue? Thanks a lot!!
Intellij compiler logs:
DEBUG - s.incremental.java.JavaBuilder - java:ERROR:Internal error in the mapping processor: com.sun.tools.javac.jvm.ClassReader$BadClassFile: bad class file: Please remove or make sure it appears in the correct subdirectory of the classpath.
at com.sun.tools.javac.jvm.ClassReader.badClassFile(ClassReader.java:357)
at com.sun.tools.javac.jvm.ClassReader.readEnclosingMethodAttr(ClassReader.java:1276)
at com.sun.tools.javac.jvm.ClassReader$12.read(ClassReader.java:1130)
at com.sun.tools.javac.jvm.ClassReader.readAttrs(ClassReader.java:1381)
at com.sun.tools.javac.jvm.ClassReader.readClassAttrs(ClassReader.java:1396)
at com.sun.tools.javac.jvm.ClassReader.readClass(ClassReader.java:2226)
at com.sun.tools.javac.jvm.ClassReader.readClassFile(ClassReader.java:2324)
at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:2511)
at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:2442)
at com.sun.tools.javac.jvm.ClassReader.access$000(ClassReader.java:76)
at com.sun.tools.javac.jvm.ClassReader$1.complete(ClassReader.java:240)
at com.sun.tools.javac.code.Symbol.complete(Symbol.java:574)
at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:1037)
at com.sun.tools.javac.code.Symbol$ClassSymbol.flags(Symbol.java:973)
at com.sun.tools.javac.code.Symbol$TypeSymbol.getEnclosedElements(Symbol.java:734)
at javax.lang.model.util.ElementScanner6.visitPackage(ElementScanner6.java:167)
at com.sun.tools.javac.code.Symbol$PackageSymbol.accept(Symbol.java:901)
at com.sun.tools.javac.processing.JavacRoundEnvironment$AnnotationSetScanner.scan(JavacRoundEnvironment.java:158)
at com.sun.tools.javac.processing.JavacRoundEnvironment$AnnotationSetScanner.scan(JavacRoundEnvironment.java:127)
at com.sun.tools.javac.processing.JavacRoundEnvironment.getElementsAnnotatedWith(JavacRoundEnvironment.java:121)
at org.mapstruct.ap.MappingProcessor.getMappers(MappingProcessor.java:235)
at org.mapstruct.ap.MappingProcessor.process(MappingProcessor.java:165)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:802)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:713)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1043)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1184)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856)

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.

NullPointerException org.gradle.wrapper.BootstrapMainStarter.findLauncherJar(BootstrapMainStarter.java:37)

Got the following stacktrace when launching gradle 1.1, anyone know how to resolve them:
Exception in thread "main" java.lang.NullPointerException
at org.gradle.wrapper.BootstrapMainStarter.findLauncherJar(BootstrapMainStarter.java:37)
at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:28)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:47)
I think the automatic unzip of the dists/gradle-1.1-bin/13d7lnhcrghv2i5e54el41jpgr/gradle-1.1-bin.zip might be failing. I checked permissions and that I have access to that directory.
If I unzip manually, then I get the following error:
Exception in thread "main" java.lang.RuntimeException: Gradle distribution 'http://services.gradle.org/distributions/gradle-1.1-bin.zip' contains too many directories. Expected to find exactly 1 directory.
at org.gradle.wrapper.Install.createDist(Install.java:73)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:47)
I did a google search for gradle nullpointerexception and it mentioned the JAVA_HOME needs to be set for compiling, but I've already checked it is set correctly and been able to compile stuff with ant in that environment.
I was getting exactly same error and I changed the version of gradle that I was using. Inside my gradle-wrapper.properties, changed version 2.4 to 2.2.1 and error is gone.

Unable to open deployment assembly option in Rational Application Developer 8.0.4

I'm using RAD 8.0.4 version. After installing plugins like SVN, Maven and PMD, when I try to open 'Deployment Assembly' option for any EAR project(right click->properties->deployment assembly) its showing that "The currently displayed page contains invalid values".
Can anyone help me out to solve this..??
I met the same issue, and the log in .metadata/log like this:
!ENTRY org.eclipse.jface 4 2 2012-11-23 11:37:45.031
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface".
!STACK 0
java.lang.NoSuchMethodError: org/eclipse/jst/j2ee/componentcore/J2EEModuleVirtualComponent.getDefaultDeploymentDescriptorFolder(Lorg/eclipse/wst/common/componentcore/resources/IVirtualFolder;)Lorg/eclipse/core/runtime/IPath;
I had this same issue. It was because I didn't have all projects being referenced, in my workspace. To fix the issue, I had to remove the references. To do that, I had to open the referenced projects first, then open the deployment assembly, and remove the reference.