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

desktop 无法使用 #68

Closed
Xiaolangs opened this issue Dec 22, 2023 · 5 comments
Closed

desktop 无法使用 #68

Xiaolangs opened this issue Dec 22, 2023 · 5 comments
Assignees

Comments

@Xiaolangs
Copy link

java.lang.IllegalAccessError: class org.cef.browser.platform.CefBrowserWindowPlatform (in unnamed module @0x22eab566) cannot access class sun.awt.AWTAccessor (in module java.desktop) because module java.desktop does not export sun.awt to unnamed module @0x22eab566
at org.cef.browser.platform.CefBrowserWindowPlatform.getWindowHandle(CefBrowserWindowPlatform.java:28)
at org.cef.browser.CefBrowserWr.getWindowHandle(CefBrowserWr.java:434)
at org.cef.browser.CefBrowserWr.getWindowHandle(CefBrowserWr.java:426)
at org.cef.browser.CefBrowserWr.createBrowserIfRequired(CefBrowserWr.java:495)
at org.cef.browser.CefBrowserWr$1$1.run(CefBrowserWr.java:65)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:771)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716)
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:741)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

@KevinnZou
Copy link
Owner

@Xiaolangs Hi! Did you follow the instructions in README.desktop.md? If so, could you please provide information about the library version and the platform of your computer?

@Xiaolangs
Copy link
Author

@Xiaolangs Hi! Did you follow the instructions in README.desktop.md? If so, could you please provide information about the library version and the platform of your computer?

Found the problem and solved it

@KevinnZou KevinnZou self-assigned this Dec 23, 2023
@LiuPack
Copy link

LiuPack commented Jan 17, 2024

你好!您是否按照 README.desktop.md 中的说明进行操作?如果是这样,您能否提供有关库版本和计算机平台的信息?

发现问题并解决

请问一下是发现出哪里的问题,我这里也有同样的错误

@Xiaolangs
Copy link
Author

你好!您是否按照 README.desktop.md 中的说明进行操作?如果是这样,您能否提供有关库版本和计算机平台的信息?

发现问题并解决

请问一下是发现出哪里的问题,我这里也有同样的错误

jvm参数跟KCEF 配置问题

@LiuPack
Copy link

LiuPack commented Jan 17, 2024

你好!您是否按照 README.desktop.md 中的说明进行操作?如果是这样,您能否提供有关库版本和计算机平台的信息?

发现问题并解决

请问一下是发现出哪里的问题,我这里也有同样的错误

jvm参数跟KCEF 配置问题

好的,我将build.gradle中配置的jvmArgs配置移入到afterEvaluate可以了

afterEvaluate {
    tasks.withType<JavaExec> {
        jvmArgs("--add-opens", "java.desktop/sun.awt=ALL-UNNAMED")
        jvmArgs(
            "--add-opens", "java.desktop/java.awt.peer=ALL-UNNAMED"
        )

        if (System.getProperty("os.name").contains("Mac")) {
            jvmArgs("--add-opens", "java.desktop/sun.awt=ALL-UNNAMED")
            jvmArgs("--add-opens", "java.desktop/sun.lwawt=ALL-UNNAMED")
            jvmArgs("--add-opens", "java.desktop/sun.lwawt.macosx=ALL-UNNAMED")
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants