Intellij Idea menu are not working when running with :runIde gradle task (no such method: sun.lwawt.macosx.LWCToolkit.invokeAndWait)

Answered

I am getting the following error while clicking on Intellij menu option after starting it with :runIde gradle task.

JCefAppConfig.class is not from a JBR module, url: jar:file:/Users/name/.gradle/caches/8.10.2/transforms/1c1f603b71ab6b68fc20e33e0487dddb/transformed/ideaIC-2024.2/lib/lib-client.jar!/com/jetbrains/cef/JCefAppConfig.class (Use JBR bundled with the IDE)
2024-12-08 12:42:03,347 [   1477]   WARN - #c.i.u.x.Binding - No accessors for org.jetbrains.kotlin.cli.common.arguments.InternalArgument. This means that state class cannot be serialized properly. Please see https://jb.gg/ij-psoc
2024-12-08 12:42:04,997 [   3127]   WARN - #c.i.u.m.s.Menu - can't find sun.lwawt.macosx.LWCToolkit method, screen menu won't be filled
java.lang.NoSuchMethodException: no such method: sun.lwawt.macosx.LWCToolkit.invokeAndWait(Runnable,Component,boolean,int)void/invokeStatic
        at java.base/java.lang.invoke.MemberName.makeAccessException(MemberName.java:976)
        at java.base/java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1117)
        at java.base/java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:3649)
        at java.base/java.lang.invoke.MethodHandles$Lookup.findStatic(MethodHandles.java:2588)
        at com.intellij.ui.mac.screenmenu.Menu.getToolkitInvokeMethod(Menu.java:436)
        at com.intellij.ui.mac.screenmenu.Menu.invokeWithLWCToolkit(Menu.java:470)
        at com.intellij.ui.mac.screenmenu.Menu.menuNeedsUpdate(Menu.java:313)
Caused by: java.lang.NoSuchMethodError: 'void sun.lwawt.macosx.LWCToolkit.invokeAndWait(java.lang.Runnable, java.awt.Component, boolean, int)'
        at java.base/java.lang.invoke.MethodHandleNatives.resolve(Native Method)
        at java.base/java.lang.invoke.MemberName$Factory.resolve(MemberName.java:1085)
        at java.base/java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1114)

 

It looks like runIde starts intellij with boot time sdk set to JAVA 17. I am not able to figure out how to change it to jetbrains JDK. Is there any configuration? Is this really caused by this or there is some other problem? 

 

IDE  INFO

IntelliJ IDEA 2024.2 (Community Edition)
Build #IC-242.20224.300, built on August 6, 2024
Runtime version: 17.0.11+7-LTS-207 aarch64
VM: Java HotSpot(TM) 64-Bit Server VM by Oracle Corporation
Toolkit: sun.lwawt.macosx.LWCToolkit
macOS 14.6.1
Kotlin analyzer version: 2.0.20-ij242-29
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 14
Metal Rendering is ON
Registry:
 ide.experimental.ui=true
Non-Bundled Plugins:
 some.playground (1.9.0)
Kotlin: 242.20224.300-IJ
 

0
3 comments

Please check if the issue persists with IntelliJ Platform Gradle Plugin 2.2.0

1

thanks Jakub Chrzanowski , it worked after the update to 2.2.0

0

Awesome! By the way, there's 2.2.1 already available, released yesterday.

0

Please sign in to leave a comment.