How to start

Having problems with building or using the JCEF Java binding? Ask your questions here.

How to start

Postby itaks » Wed Mar 09, 2022 6:05 pm

Hi,
I developed java software using javafx.
I want to switch to JCEF because javafx Broswer is too slow.

I didn’t understand how to start using jcef.

I specify that my software runs on a raspberry pi4 with ARM processor, so I would like to understand first if using jcef was possible and if there was a guide on how to compile even a simple hello world project.

Thank you.
itaks
Techie
 
Posts: 18
Joined: Wed Mar 09, 2022 6:00 pm

Re: How to start

Postby magreenblatt » Wed Mar 09, 2022 7:31 pm

I have not tried JCEF on ARM, but there’s no particular reason why it shouldn’t work. CEF provides ARM binaries but you may need to update the JCEF config to work with them. You can start with the build instructions at https://bitbucket.org/chromiumembedded/ ... uilding.md
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: How to start

Postby amaitland » Wed Mar 09, 2022 7:57 pm

I came across https://github.com/jcefmaven/jcefmaven#jcef-maven the other day.

I thought they had arm64 listed.
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1290
Joined: Wed Jan 14, 2015 2:35 am

Re: How to start

Postby FriwiDev » Sat Mar 12, 2022 6:04 am

Yeah, I currently provide arm64 builds in jcefmaven on an untested - experimental basis. Feel free to test them out and submit a test report. If you want to test if jcefmaven works on your (and other) PIs, feel free to use the precompiled sample app from here: https://github.com/jcefmaven/jcefsampleapp
Maintainer of jcefmaven on GitHub.
FriwiDev
Techie
 
Posts: 41
Joined: Sun Jul 09, 2017 4:18 am

Re: How to start

Postby itaks » Wed Mar 16, 2022 2:30 pm

FriwiDev wrote:Yeah, I currently provide arm64 builds in jcefmaven on an untested - experimental basis. Feel free to test them out and submit a test report. If you want to test if jcefmaven works on your (and other) PIs, feel free to use the precompiled sample app from here: https://github.com/jcefmaven/jcefsampleapp



Hi,
i've tried your project but i have some problem.

This is the debug:

Code: Select all
Please consider reporting back whether this build worked on your platform or not.
To report back, follow these 3 (1/2) easy steps (it will take ~1 minute):
    1) Check if everything is working
    2) Go to https://github.com/jcefmaven/jcefmaven/issues/new?assignees=&labels=test+report&template=report_artifact_working.md&title=%5BTR%5D+Test+report
    3) Paste the following report as the issue text. Replace <Y/N> under "Working?" with Y or N.
    4) If the build did not work, make sure to add debug info like console output or screenshots below.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Test report generated by JCefSampleApp
**Tag**
{mvn_version}

**OS (linux/windows/macosx)**
macosx

**Version/Flavor (e.g. Ubuntu 20.04, Windows 10, Big Sur)**
macOS 12.1 (11.1)

**Arch (amd64/i386/arm64/arm)**
amd64

**Report as working? (Y/N)**
<Y/N>

**Did you test with the official sample app? (Y/N)**
Y

**Additional information**
Your additional info and additional text here, if you want to tell us something.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mar 16, 2022 8:29:31 PM me.friwi.jcefmaven.impl.progress.ConsoleProgressHandler handleProgress
INFO: LOCATING |> In progress...
mar 16, 2022 8:29:31 PM me.friwi.jcefmaven.impl.progress.ConsoleProgressHandler handleProgress
INFO: INITIALIZING |> In progress...
mar 16, 2022 8:29:31 PM me.friwi.jcefmaven.impl.progress.ConsoleProgressHandler handleProgress
INFO: INITIALIZED |> In progress...
initialize on Thread[AWT-EventQueue-0,6,main] with library path /Users/macuser/Downloads/jcefsampleapp-master/jcef-bundle
[0316/202932.321084:ERROR:gpu_process_host.cc(973)] GPU process launch failed: error_code=1003
[0316/202932.321617:WARNING:gpu_process_host.cc(1292)] The GPU process has crashed 1 time(s)
[0316/202932.415596:ERROR:gpu_process_host.cc(973)] GPU process launch failed: error_code=1003
[0316/202932.415649:WARNING:gpu_process_host.cc(1292)] The GPU process has crashed 2 time(s)
[0316/202932.444297:ERROR:gpu_process_host.cc(973)] GPU process launch failed: error_code=1003
[0316/202932.444347:WARNING:gpu_process_host.cc(1292)] The GPU process has crashed 3 time(s)
[0316/202932.447798:ERROR:gpu_process_host.cc(973)] GPU process launch failed: error_code=1003
[0316/202932.447836:WARNING:gpu_process_host.cc(1292)] The GPU process has crashed 4 time(s)
[0316/202932.482946:ERROR:gpu_process_host.cc(973)] GPU process launch failed: error_code=1003
[0316/202932.483003:WARNING:gpu_process_host.cc(1292)] The GPU process has crashed 5 time(s)
[0316/202932.495097:ERROR:gpu_process_host.cc(973)] GPU process launch failed: error_code=1003
[0316/202932.495150:WARNING:gpu_process_host.cc(1292)] The GPU process has crashed 6 time(s)
[0316/202932.502141:ERROR:gpu_process_host.cc(973)] GPU process launch failed: error_code=1003
[0316/202932.502185:WARNING:gpu_process_host.cc(1292)] The GPU process has crashed 7 time(s)
[0316/202932.508086:ERROR:gpu_process_host.cc(973)] GPU process launch failed: error_code=1003
[0316/202932.508133:WARNING:gpu_process_host.cc(1292)] The GPU process has crashed 8 time(s)
[0316/202932.514951:ERROR:gpu_process_host.cc(973)] GPU process launch failed: error_code=1003
[0316/202932.515000:WARNING:gpu_process_host.cc(1292)] The GPU process has crashed 9 time(s)
[0316/202932.515023:FATAL:gpu_data_manager_impl_private.cc(417)] GPU process isn't usable. Goodbye.

Process finished with exit code 133 (interrupted by signal 5: SIGTRAP)


could you help me?

If you want we can talk with skype or email, if you want.

Thank you
itaks
Techie
 
Posts: 18
Joined: Wed Mar 09, 2022 6:00 pm

Re: How to start

Postby FriwiDev » Tue Mar 22, 2022 7:02 am

Hey, this is an error on newer macos versions that has just been fixed starting with version 10. Just update your dependency ;)
Maintainer of jcefmaven on GitHub.
FriwiDev
Techie
 
Posts: 41
Joined: Sun Jul 09, 2017 4:18 am

Re: How to start

Postby itaks » Sat Mar 26, 2022 2:11 pm

FriwiDev wrote:Hey, this is an error on newer macos versions that has just been fixed starting with version 10. Just update your dependency ;)


Hi thank for your replay.

I managed to view the screen with google only if boolean useOsr = true;

When it's setted to true i see an exception

Code: Select all
Warning: the fonts "Times" and "Times" are not available for the Java logical font "Serif", which may have unexpected appearance or behavior. Re-enable the "Times" font to remove this warning.
Exception in thread "main" java.lang.IllegalAccessError: class org.cef.browser.mac.CefBrowserWindowMac (in unnamed module @0x687080dc) cannot access class sun.awt.AWTAccessor (in module java.desktop) because module java.desktop does not export sun.awt to unnamed module @0x687080dc


If i set false i cannot view the window and i see this exception:

Code: Select all
initialize on Thread[AWT-EventQueue-0,6,main] with library path /Users/macuser/Downloads/jcefsampleapp-master 3/jcef-bundle
Warning: the fonts "Times" and "Times" are not available for the Java logical font "Serif", which may have unexpected appearance or behavior. Re-enable the "Times" font to remove this warning.
Caught AppContextInfo(Bug 1004) InaccessibleObjectException: Unable to make public static sun.awt.AppContext sun.awt.AppContext.getAppContext() accessible: module java.desktop does not "exports sun.awt" to unnamed module @306279ee on thread main
    [0]: java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:357)
    [1]: java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
    [2]: java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
    [3]: java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
    [4]: com.jogamp.nativewindow.awt.AppContextInfo$1$1.run(AppContextInfo.java:40)
    [5]: com.jogamp.common.util.UnsafeUtil.doWithoutIllegalAccessLogger(UnsafeUtil.java:202)
    [6]: com.jogamp.nativewindow.awt.AppContextInfo$1.run(AppContextInfo.java:34)
    [7]: java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
    [8]: com.jogamp.nativewindow.awt.AppContextInfo.<clinit>(AppContextInfo.java:31)
    [9]: com.jogamp.nativewindow.awt.JAWTWindow.<init>(JAWTWindow.java:128)
    [10]: jogamp.nativewindow.jawt.macosx.MacOSXJAWTWindow.<init>(MacOSXJAWTWindow.java:79)
    [11]: java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    [12]: java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:78)
    [13]: java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    [14]: java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
    [15]: java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
    [16]: jogamp.nativewindow.NativeWindowFactoryImpl.getAWTNativeWindow(NativeWindowFactoryImpl.java:105)
    [17]: jogamp.nativewindow.NativeWindowFactoryImpl.getNativeWindowImpl(NativeWindowFactoryImpl.java:66)
    [18]: com.jogamp.nativewindow.NativeWindowFactory.getNativeWindow(NativeWindowFactory.java:654)
    [19]: com.jogamp.opengl.awt.GLCanvas.createJAWTDrawableAndContext(GLCanvas.java:716)
    [20]: com.jogamp.opengl.awt.GLCanvas.addNotify(GLCanvas.java:621)
    [21]: org.cef.browser.CefBrowserOsr$1.addNotify(CefBrowserOsr.java:194)
    [22]: java.desktop/java.awt.Container.addNotify(Container.java:2801)
    [23]: java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4792)
    [24]: java.desktop/java.awt.Container.addNotify(Container.java:2801)
    [25]: java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4792)
    [26]: java.desktop/java.awt.Container.addNotify(Container.java:2801)
    [27]: java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4792)
    [28]: java.desktop/javax.swing.JRootPane.addNotify(JRootPane.java:729)
    [29]: java.desktop/java.awt.Container.addNotify(Container.java:2801)
    [30]: java.desktop/java.awt.Window.addNotify(Window.java:787)
    [31]: java.desktop/java.awt.Frame.addNotify(Frame.java:493)
    [32]: java.desktop/java.awt.Window.pack(Window.java:825)
    [33]: me.friwi.jcefsampleapp.MainFrame.<init>(MainFrame.java:173)
    [34]: me.friwi.jcefsampleapp.MainFrame.main(MainFrame.java:197)
Caught AppContextInfo(Bug 1004) IllegalAccessException: class com.jogamp.nativewindow.awt.AppContextInfo cannot access class sun.awt.AppContext (in module java.desktop) because module java.desktop does not export sun.awt to unnamed module @306279ee on thread main
    [0]: java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:385)
    [1]: java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:687)
    [2]: java.base/java.lang.reflect.Method.invoke(Method.java:559)
    [3]: com.jogamp.nativewindow.awt.AppContextInfo.fetchAppContext(AppContextInfo.java:191)
    [4]: com.jogamp.nativewindow.awt.AppContextInfo.update(AppContextInfo.java:135)
    [5]: com.jogamp.nativewindow.awt.AppContextInfo.<init>(AppContextInfo.java:50)
    [6]: com.jogamp.nativewindow.awt.JAWTWindow.<init>(JAWTWindow.java:128)
    [7]: jogamp.nativewindow.jawt.macosx.MacOSXJAWTWindow.<init>(MacOSXJAWTWindow.java:79)
    [8]: java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    [9]: java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:78)
    [10]: java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    [11]: java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
    [12]: java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
    [13]: jogamp.nativewindow.NativeWindowFactoryImpl.getAWTNativeWindow(NativeWindowFactoryImpl.java:105)
    [14]: jogamp.nativewindow.NativeWindowFactoryImpl.getNativeWindowImpl(NativeWindowFactoryImpl.java:66)
    [15]: com.jogamp.nativewindow.NativeWindowFactory.getNativeWindow(NativeWindowFactory.java:654)
    [16]: com.jogamp.opengl.awt.GLCanvas.createJAWTDrawableAndContext(GLCanvas.java:716)
    [17]: com.jogamp.opengl.awt.GLCanvas.addNotify(GLCanvas.java:621)
    [18]: org.cef.browser.CefBrowserOsr$1.addNotify(CefBrowserOsr.java:194)
    [19]: java.desktop/java.awt.Container.addNotify(Container.java:2801)
    [20]: java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4792)
    [21]: java.desktop/java.awt.Container.addNotify(Container.java:2801)
    [22]: java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4792)
    [23]: java.desktop/java.awt.Container.addNotify(Container.java:2801)
    [24]: java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4792)
    [25]: java.desktop/javax.swing.JRootPane.addNotify(JRootPane.java:729)
    [26]: java.desktop/java.awt.Container.addNotify(Container.java:2801)
    [27]: java.desktop/java.awt.Window.addNotify(Window.java:787)
    [28]: java.desktop/java.awt.Frame.addNotify(Frame.java:493)
    [29]: java.desktop/java.awt.Window.pack(Window.java:825)
    [30]: me.friwi.jcefsampleapp.MainFrame.<init>(MainFrame.java:173)
    [31]: me.friwi.jcefsampleapp.MainFrame.main(MainFrame.java:197)
Caught AppContextInfo(Bug 1004) IllegalAccessException: class com.jogamp.nativewindow.awt.AppContextInfo cannot access class sun.awt.AppContext (in module java.desktop) because module java.desktop does not export sun.awt to unnamed module @306279ee on thread AppKit Thread
    [0]: java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:385)
    [1]: java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:687)
    [2]: java.base/java.lang.reflect.Method.invoke(Method.java:559)
    [3]: com.jogamp.nativewindow.awt.AppContextInfo.fetchAppContext(AppContextInfo.java:191)
    [4]: com.jogamp.nativewindow.awt.AppContextInfo.update(AppContextInfo.java:135)
    [5]: com.jogamp.nativewindow.awt.AppContextInfo.invokeOnAppContextThread(AppContextInfo.java:107)
    [6]: com.jogamp.nativewindow.awt.JAWTWindow.attachSurfaceLayer(JAWTWindow.java:492)
    [7]: jogamp.opengl.macosx.cgl.MacOSXCGLContext$NSOpenGLImpl$AttachGLLayerCmd.run(MacOSXCGLContext.java:821)
    [8]: com.jogamp.common.util.RunnableTask.run(RunnableTask.java:125)


Could you help me?

Thank you
itaks
Techie
 
Posts: 18
Joined: Wed Mar 09, 2022 6:00 pm

Re: How to start

Postby FriwiDev » Sun Mar 27, 2022 4:46 am

This is currently an error in jogamp (second error) or jcef (first error) starting with jdk 16. Up to jdk 15 everything should work as expected. For jdk 16 you can use the jvm flag:
Code: Select all
--illegal-access=permit
If you run on jdk 17 you are out of luck until jogamp provides a fix for this.
The on screen rendering exception is not intended and should be fixed in jcef by including a module definition. Maybe consider opening a bug report? (Only if there is not an already open bug. I believe there is, mentioning the jogamp error. Maybe add your problem there.)
Maintainer of jcefmaven on GitHub.
FriwiDev
Techie
 
Posts: 41
Joined: Sun Jul 09, 2017 4:18 am

Re: How to start

Postby itaks » Sun Mar 27, 2022 12:10 pm

FriwiDev wrote:This is currently an error in jogamp (second error) or jcef (first error) starting with jdk 16. Up to jdk 15 everything should work as expected. For jdk 16 you can use the jvm flag:
Code: Select all
--illegal-access=permit
If you run on jdk 17 you are out of luck until jogamp provides a fix for this.
The on screen rendering exception is not intended and should be fixed in jcef by including a module definition. Maybe consider opening a bug report? (Only if there is not an already open bug. I believe there is, mentioning the jogamp error. Maybe add your problem there.)


Hi,
thank for your relply.

Where i can open the bug?

Also when I try to start the jar on my raspberry PI I notice that it cannot read the contents of the jcef-build folder.

The error is Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/bin/jcef-bundle/libjcef.so: /usr/bin/jcef-bundle/libjcef.so: unable to open shared object file: File or directory does not exist.

Actually the folder and the file exist.

Do you know if I need to set any permissions?

I have set read and write rights on each file and folder.

Thank you for the support.
itaks
Techie
 
Posts: 18
Joined: Wed Mar 09, 2022 6:00 pm

Re: How to start

Postby FriwiDev » Sun Mar 27, 2022 4:49 pm

Hmm, the no such file error will only occur if the file does not exist. So I suggest you double check that. If you had no permission, the error would tell you so. Did you configure the /usr/bin path manually? If so, why?

You can add to the bug report here: https://bitbucket.org/chromiumembedded/ ... sexception
Maintainer of jcefmaven on GitHub.
FriwiDev
Techie
 
Posts: 41
Joined: Sun Jul 09, 2017 4:18 am

Next

Return to JCEF Forum

Who is online

Users browsing this forum: No registered users and 19 guests