简体   繁体   English

不能使用从代号一创建 CEF 浏览器

[英]can't use create CEF browser from codename one

My app is failing to run the BrowserComponent everytime I try to call it inside codename one.每次我尝试在代号一中调用它时,我的应用程序都无法运行 BrowserComponent。 It gives me an error of failure to create CEF browser.它给了我一个创建 CEF 浏览器失败的错误。 Everything beside that is running just fine.除此之外的一切都运行良好。 I uninstalled and installed CEF as instructed in this link Codename One CEF Support I tried to fix my problem as I found it inside Known Issues from the previous link我按照此链接中的说明卸载并安装了 CEF 代号一个 CEF 支持我试图解决我的问题,因为我在上一个链接的已知问题中找到了它

I did as instructed and tried to fix the LD_LIBRARY_PATH我按照指示做了并尝试修复LD_LIBRARY_PATH

here is the output of my terminal after I did so:这是我这样做后终端的 output :

[kagha@archbios ~]$ whereis java
java: /usr/bin/java /usr/share/java /usr/lib/jvm/java-8-jdk/bin/java
[kagha@archbios ~]$ echo $JAVA_HOME
/usr/lib/jvm/java-8-jdk
[kagha@archbios ~]$ echo  $LD_LIBRARY_PATH
/usr/lib/jvm/java-8-jdk/lib/amd64
[kagha@archbios ~]$ find /usr/lib/jvm/java-8-jdk/ | grep "libawt.so"
/usr/lib/jvm/java-8-jdk/jre/lib/amd64/libawt.so

but the problem is still there I am using the OS Arch Linux with Kernel version 5.10.32-1-lts and Apache netbeans 12.1 as an IDE but the problem is still there I am using the OS Arch Linux with Kernel version 5.10.32-1-lts and Apache netbeans 12.1 as an IDE

The code I am trying to run我试图运行的代码

Form hi = new Form("Browser", new BorderLayout());
BrowserComponent browser = new BrowserComponent();
browser.setURL("https://www.codenameone.com/");
hi.add(BorderLayout.CENTER, browser);*/

Here is the full error in the console:这是控制台中的完整错误:

[EDT] 0:0:0,282 - Attempting to create browser component
[AWT-EventQueue-0] 0:0:0,284 - Attempting to create browser component
java.lang.UnsatisfiedLinkError: /home/kagha/.codenameone/cef/lib/linux64/libjcef.so: libjawt.so: cannot open shared object file: No such file or directory
[EDT] 0:0:0,326 - Exception: java.lang.UnsatisfiedLinkError - /home/kagha/.codenameone/cef/lib/linux64/libjcef.so: libjawt.so: cannot open shared object file: No such file or directory
[EDT] 0:0:0,327 - Exception: java.lang.RuntimeException - Failed to create CEF browser
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1934)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1830)
    at java.lang.Runtime.loadLibrary0(Runtime.java:871)
    at java.lang.System.loadLibrary(System.java:1122)
    at org.cef.SystemBootstrap$1.loadLibrary(SystemBootstrap.java:24)
    at org.cef.SystemBootstrap.loadLibrary(SystemBootstrap.java:36)
    at org.cef.CefApp.startup(CefApp.java:536)
    at com.codename1.impl.javase.cef.CEFBrowserComponent.create(CEFBrowserComponent.java:207)
    at com.codename1.impl.javase.cef.CEFBrowserComponent.create(CEFBrowserComponent.java:199)
    at com.codename1.impl.javase.cef.CEFBrowserComponent.create(CEFBrowserComponent.java:196)
    at com.codename1.impl.javase.cef.JavaCEFSEPort.createCEFBrowserComponent(JavaCEFSEPort.java:139)
    at com.codename1.impl.javase.cef.JavaCEFSEPort$2.run(JavaCEFSEPort.java:121)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:301)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
java.lang.RuntimeException: Failed to create CEF browser
    at com.codename1.impl.javase.cef.JavaCEFSEPort.createCEFBrowserComponent(JavaCEFSEPort.java:133)
    at com.codename1.impl.javase.cef.JavaCEFSEPort.createBrowserComponent(JavaCEFSEPort.java:98)
    at com.codename1.ui.BrowserComponent$9.run(BrowserComponent.java:557)
    at com.codename1.ui.Display.processSerialCalls(Display.java:1338)
    at com.codename1.ui.Display.edtLoopImpl(Display.java:1280)
    at com.codename1.ui.Display.mainEDTLoop(Display.java:1162)
    at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
    at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
Caused by: java.lang.UnsatisfiedLinkError: /home/kagha/.codenameone/cef/lib/linux64/libjcef.so: libjawt.so: cannot open shared object file: No such file or directory
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1934)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1830)
    at java.lang.Runtime.loadLibrary0(Runtime.java:871)
    at java.lang.System.loadLibrary(System.java:1122)
    at org.cef.SystemBootstrap$1.loadLibrary(SystemBootstrap.java:24)
    at org.cef.SystemBootstrap.loadLibrary(SystemBootstrap.java:36)
    at org.cef.CefApp.startup(CefApp.java:536)
    at com.codename1.impl.javase.cef.CEFBrowserComponent.create(CEFBrowserComponent.java:207)
    at com.codename1.impl.javase.cef.CEFBrowserComponent.create(CEFBrowserComponent.java:199)
    at com.codename1.impl.javase.cef.CEFBrowserComponent.create(CEFBrowserComponent.java:196)
    at com.codename1.impl.javase.cef.JavaCEFSEPort.createCEFBrowserComponent(JavaCEFSEPort.java:139)
    at com.codename1.impl.javase.cef.JavaCEFSEPort$2.run(JavaCEFSEPort.java:121)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:301)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
BUILD SUCCESSFUL (total time: 8 seconds)

I will appreciate any help and provide more information if needed, thanks in advance如果需要,我将不胜感激并提供更多信息,在此先感谢

You should use the new Maven support .您应该使用新的Maven 支持 This should fix issue as the Maven plugin will automatically add the needed entries to the LD_LIBRARY_PATH .这应该可以解决问题,因为 Maven 插件会自动将所需的条目添加到LD_LIBRARY_PATH

You can download a base template from https://start.codenameone.com and just paste your code there.您可以从https://start.codenameone.com下载基本模板,然后将代码粘贴到那里。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM