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

java.lang.IllegalAccessError fails on IntelliJ IDEA v2022.2 #807

Closed
padis opened this issue Jul 28, 2022 · 3 comments
Closed

java.lang.IllegalAccessError fails on IntelliJ IDEA v2022.2 #807

padis opened this issue Jul 28, 2022 · 3 comments
Labels

Comments

@padis
Copy link

padis commented Jul 28, 2022

When creates a new Test or class fails with this error:
java.lang.IllegalAccessError: class com.google.googlejavaformat.java.JavaInput (in unnamed module @0x34c31d27) cannot access class com.sun.tools.javac.parser.Tokens$TokenKind (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.parser to unnamed module @0x34c31d27
at com.google.googlejavaformat.java.JavaInput.buildToks(JavaInput.java:349)
at com.google.googlejavaformat.java.JavaInput.buildToks(JavaInput.java:334)
at com.google.googlejavaformat.java.JavaInput.(JavaInput.java:276)
at com.google.googlejavaformat.java.Formatter.getFormatReplacements(Formatter.java:260)
at com.google.googlejavaformat.intellij.FormatterUtil.getReplacements(FormatterUtil.java:40)
at com.google.googlejavaformat.intellij.GoogleJavaFormatCodeStyleManager.format(GoogleJavaFormatCodeStyleManager.java:150)
at com.google.googlejavaformat.intellij.GoogleJavaFormatCodeStyleManager.formatInternal(GoogleJavaFormatCodeStyleManager.java:137)
at com.google.googlejavaformat.intellij.GoogleJavaFormatCodeStyleManager.reformatText(GoogleJavaFormatCodeStyleManager.java:59)
at com.intellij.codeInsight.template.impl.TemplateState.reformat(TemplateState.java:1231)
at com.intellij.codeInsight.template.impl.TemplateState.lambda$doReformat$2(TemplateState.java:416)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1023)
at com.intellij.codeInsight.template.impl.TemplateState.doReformat(TemplateState.java:421)
at com.intellij.codeInsight.template.impl.TemplateState.lambda$processAllExpressions$1(TemplateState.java:364)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1023)
at com.intellij.codeInsight.template.impl.TemplateState.processAllExpressions(TemplateState.java:397)
at com.intellij.codeInsight.template.impl.TemplateState.start(TemplateState.java:337)
at com.intellij.codeInsight.template.impl.TemplateState.start(TemplateState.java:299)
at com.intellij.codeInsight.template.impl.TemplateManagerImpl.lambda$startTemplate$2(TemplateManagerImpl.java:170)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:210)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:174)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:164)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:150)
at com.intellij.codeInsight.template.impl.TemplateManagerImpl.startTemplate(TemplateManagerImpl.java:173)
at com.intellij.codeInsight.template.impl.TemplateManagerImpl.startTemplate(TemplateManagerImpl.java:191)
at com.intellij.testIntegration.TestIntegrationUtils.runTestMethodTemplate(TestIntegrationUtils.java:214)
at com.intellij.testIntegration.TestIntegrationUtils.runTestMethodTemplate(TestIntegrationUtils.java:173)
at com.intellij.testIntegration.createTest.JavaTestGenerator.generateMethod(JavaTestGenerator.java:258)
at com.intellij.testIntegration.createTest.JavaTestGenerator.addTestMethods(JavaTestGenerator.java:238)
at com.intellij.testIntegration.createTest.JavaTestGenerator$1.compute(JavaTestGenerator.java:80)
at com.intellij.testIntegration.createTest.JavaTestGenerator$1.compute(JavaTestGenerator.java:61)
at com.intellij.openapi.application.impl.ApplicationImpl.lambda$runWriteAction$13(ApplicationImpl.java:1032)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteActionWithClass(ApplicationImpl.java:1011)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1032)
at com.intellij.testIntegration.createTest.JavaTestGenerator.lambda$generateTest$0(JavaTestGenerator.java:61)
at com.intellij.psi.impl.source.PostprocessReformattingAspect.postponeFormattingInside(PostprocessReformattingAspect.java:146)
at com.intellij.testIntegration.createTest.JavaTestGenerator.generateTest(JavaTestGenerator.java:60)
at com.intellij.testIntegration.createTest.CreateTestAction.lambda$invoke$0(CreateTestAction.java:123)
at com.intellij.openapi.project.DumbService.withAlternativeResolveEnabled(DumbService.java:355)
at com.intellij.testIntegration.createTest.CreateTestAction.lambda$invoke$1(CreateTestAction.java:123)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:219)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:174)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:164)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:150)
at com.intellij.testIntegration.createTest.CreateTestAction.invoke(CreateTestAction.java:120)
at com.intellij.testIntegration.JavaTestCreator.createTest(JavaTestCreator.java:42)
at com.intellij.testIntegration.GotoTestOrCodeHandler$1.execute(GotoTestOrCodeHandler.java:93)
at com.intellij.codeInsight.navigation.GotoTargetHandler.lambda$show$2(GotoTargetHandler.java:134)
at com.intellij.ui.popup.PopupListAdapter.lambda$setItemsChosenCallback$1(PopupListAdapter.java:65)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:94)
at com.intellij.ui.popup.AbstractPopup.lambda$dispose$18(AbstractPopup.java:1543)
at com.intellij.util.ui.EdtInvocationManager.invokeLaterIfNeeded(EdtInvocationManager.java:113)
at com.intellij.ide.IdeEventQueue.ifFocusEventsInTheQueue(IdeEventQueue.java:179)
at com.intellij.ide.IdeEventQueue.executeWhenAllFocusEventsLeftTheQueue(IdeEventQueue.java:132)
at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:163)
at com.intellij.ui.popup.AbstractPopup.dispose(AbstractPopup.java:1540)
at com.intellij.openapi.util.ObjectTree.runWithTrace(ObjectTree.java:126)
at com.intellij.openapi.util.ObjectTree.executeAll(ObjectTree.java:158)
at com.intellij.openapi.util.Disposer.dispose(Disposer.java:217)
at com.intellij.ui.popup.AbstractPopup.cancel(AbstractPopup.java:800)
at com.intellij.ui.popup.AbstractPopup.closeOk(AbstractPopup.java:734)
at com.intellij.openapi.ui.popup.PopupChooserBuilder.closePopup(PopupChooserBuilder.java:470)
at com.intellij.openapi.ui.popup.PopupChooserBuilder$1.mouseReleased(PopupChooserBuilder.java:329)
at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:298)
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6648)
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3392)
at java.desktop/java.awt.Component.processEvent(Component.java:6413)
at java.desktop/java.awt.Container.processEvent(Container.java:2266)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5022)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4854)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2802)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4854)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:781)
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.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:754)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:752)
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:751)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:898)
at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:820)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:743)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:439)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:791)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:438)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:113)
at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:604)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:436)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:881)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:484)
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)

@tbroyer
Copy link
Contributor

tbroyer commented Jul 28, 2022

Duplicate of #787 (and many many others)

@cushon cushon added the IntelliJ label Aug 1, 2022
@javatlacati
Copy link

In my case it was fixed with #787 (comment)

@plumpy
Copy link
Collaborator

plumpy commented Mar 3, 2023

Close as Dup of #787, as others mentioned. 1.16.0.0 will give you instructions on how to fix this.

@plumpy plumpy closed this as completed Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants