Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
436 views
in Technique[技术] by (71.8m points)

java - Intellij IDEA JCEF: Cannot find startup() method in JBR IDE

I'm trying to add a WebView (JCEF) as part of a plugin project I'm making for Intellij IDEA. I'm having quite a few issues with it, but I will probably solve most of them. This one I've been working on for hours and still haven't found a fix, so I'm hoping someone here will have some idea.

I have added this to my gradle .kts build file (I think this is the latest JBR IDE version):

runIde {
    setJbrVersion("jbr_jcef-11_0_9_1b1244.2")
}

The IDE launches fine, but when I click the button that should open the WebView, I get the following error:

ERROR - .wm.impl.ToolWindowManagerImpl - Cannot init toolwindow com.example.project.toolWindows.JavaLearnHomeToolWindow@3f9c460e java.lang.NoSuchMethodError: 'boolean org.cef.CefApp.startup()'

(The tool window is completely empty)

When I manually install the plugin via. the settings on my main IDE (2020.3.1), the browser opens fine. So, I'm presuming that the JBR version does not have the correct version of JCEF. I cannot find how to fix this issue. Here is the code for my window, if needed (please note that I have tried with and without my custom scheme handler (which doesn't work either)):

class JavaLearnHomeToolWindowPanel() : SimpleToolWindowPanel(true, false) {

    val browser: JBCefBrowser = JBCefBrowser()
    val browserComponent = browser.component

    init {
        registerAppSchemeHandler()
        browser.loadURL("http://javalearn/index.html")
        browser.openDevtools()
    }

    private fun registerAppSchemeHandler() {
        CefApp.getInstance().registerSchemeHandlerFactory("http", "javalearn", CustomSchemeHandlerFactory())
    }

}

Thanks in advance!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...