sourcegraph / jetbrains

Apache License 2.0
61 stars 19 forks source link

bug: java.lang.IllegalStateException: JCEF is not supported in this env or failed to initialize #2250

Open Hotcomin opened 1 week ago

Hotcomin commented 1 week ago

IDE Information

Android Studio Koala Feature Drop | 2024.1.2 Build #AI-241.18034.62.2412.12266719, built on August 22, 2024 Runtime version: 17.0.11+0-17.0.11b1207.24-11852314 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Linux 6.8.0-41-generic GC: G1 Young Generation, G1 Old Generation Memory: 2048M Cores: 12 Registry: ide.experimental.ui=true Non-Bundled Plugins: com.sourcegraph.jetbrains (7.0.0) Current Desktop: ubuntu:GNOME

Bug Description

does not open cody

Additional context

Stacktrace:

java.lang.IllegalStateException: JCEF is not supported in this env or failed to initialize
    at com.intellij.ui.jcef.JBCefApp.getInstance(JBCefApp.java:157)
    at com.intellij.ui.jcef.JBCefBrowserBase.lambda$new$3(JBCefBrowserBase.java:159)
    at com.intellij.util.ObjectUtils.notNull(ObjectUtils.java:121)
    at com.intellij.ui.jcef.JBCefBrowserBase.<init>(JBCefBrowserBase.java:159)
    at com.intellij.ui.jcef.JBCefBrowser.<init>(JBCefBrowser.java:191)
    at com.intellij.ui.jcef.JBCefBrowser.create(JBCefBrowser.java:141)
    at com.intellij.ui.jcef.JBCefBrowserBuilder.build(JBCefBrowserBuilder.java:128)
    at com.sourcegraph.cody.ui.WebUIProxy$Companion.create(CodyToolWindowFactory.kt:437)
    at com.sourcegraph.cody.ui.WebUIService.createWebviewView(CodyToolWindowFactory.kt:205)
    at com.sourcegraph.cody.ui.WebviewViewService.provideView(WebViewViewToolWindow.kt:146)
    at com.sourcegraph.cody.ui.WebviewViewService.registerProvider$lambda$1(WebViewViewToolWindow.kt:114)
    at com.intellij.openapi.application.ActionsKt.invokeLater$lambda$5(actions.kt:66)
    at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:209)
    at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:22)
    at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:191)
    at com.intellij.openapi.application.impl.RwLockHolder.runIntendedWriteActionOnCurrentThread(RwLockHolder.kt:204)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:830)
    at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:419)
    at com.intellij.openapi.application.impl.RwLockHolder.runWithEnabledImplicitRead(RwLockHolder.kt:138)
    at com.intellij.openapi.application.impl.RwLockHolder.runWithImplicitRead(RwLockHolder.kt:129)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWithImplicitRead(ApplicationImpl.java:1152)
    at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:81)
    at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:123)
    at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:43)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:792)
    at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
    at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733)
    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:761)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:699)
    at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$12(IdeEventQueue.kt:593)
    at com.intellij.openapi.application.impl.RwLockHolder.runWithoutImplicitRead(RwLockHolder.kt:105)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:593)
    at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:77)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:362)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:361)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:843)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:361)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:356)
    at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1022)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
    at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1022)
    at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:356)
    at com.intellij.openapi.application.impl.RwLockHolder.runIntendedWriteActionOnCurrentThread(RwLockHolder.kt:209)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:830)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:398)
    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)
dominiccooney commented 1 week ago

@Hotcomin you can try Shift-shift, Choose Boot Java Runtime for the IDE and pick a Java runtime which supports JCEF ("with JCEF").

If that doesn't work, can you enable internal mode, then check (Tools, Internal Actions, Registry) how these settings are configured and what Linux distro you're using?

ide.browser.jcef.enable
ide.browser.jcef.sandbox.enable
ide.browser.jcef.sandbox.disable_linux_os_check

@MaedahBatool , when we resolve this, could we add some documentation for this for Android Studio/Linux users?

MaedahBatool commented 6 days ago

@dominiccooney sounds good. I can add it to our troubleshooting docs. Let me know once it's resolved.

sn-mokkun commented 4 days ago

FYI I have the same issue on macOS Sonoma

Edit: this solved the issue for me on Android Studio

Choose Boot Java Runtime for the IDE and pick a Java runtime which supports JCEF ("with JCEF").