5

Recently migrated to JxBrowser 7.0 and i have the following error coming every time i try to start the application .

com.teamdev.jxbrowser.internal.ChromiumExtractorException: Failed to extract Chromium binaries into C:\Personal Projects\Github\XR3Player\target\classes\Chrome7.0
    at jxbrowser@7.0/com.teamdev.jxbrowser.internal.ChromiumExtractor.extract(ChromiumExtractor.java:45)
    at jxbrowser@7.0/com.teamdev.jxbrowser.engine.internal.EngineImpl.extractChromiumBinaries(EngineImpl.java:386)
    at jxbrowser@7.0/com.teamdev.jxbrowser.engine.internal.EngineImpl.newInstance(EngineImpl.java:156)
    at jxbrowser@7.0/com.teamdev.jxbrowser.engine.Engine.newInstance(Engine.java:96)
    at XR3Player/com.goxr3plus.xr3player.controllers.chromium.WebBrowserTabController.initialize(WebBrowserTabController.java:191)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:567)
    at com.sun.javafx.reflect.Trampoline.invoke(MethodUtil.java:76)
    at jdk.internal.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:567)
    at javafx.base/com.sun.javafx.reflect.MethodUtil.invoke(MethodUtil.java:273)
    at javafx.fxml/com.sun.javafx.fxml.MethodHelper.invoke(MethodHelper.java:83)
    at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2591)
    at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2466)
    at javafx.fxml/javafx.fxml.FXMLLoader.load(FXMLLoader.java:2435)
    at XR3Player/com.goxr3plus.xr3player.controllers.chromium.WebBrowserTabController.<init>(WebBrowserTabController.java:166)
    at XR3Player/com.goxr3plus.xr3player.controllers.chromium.WebBrowserController.createNewTab(WebBrowserController.java:180)
    at XR3Player/com.goxr3plus.xr3player.controllers.chromium.WebBrowserController.createAndAddNewTab(WebBrowserController.java:161)
    at XR3Player/com.goxr3plus.xr3player.controllers.chromium.WebBrowserController.initialize(WebBrowserController.java:116)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:567)
    at com.sun.javafx.reflect.Trampoline.invoke(MethodUtil.java:76)
    at jdk.internal.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:567)
    at javafx.base/com.sun.javafx.reflect.MethodUtil.invoke(MethodUtil.java:273)
    at javafx.fxml/com.sun.javafx.fxml.MethodHelper.invoke(MethodHelper.java:83)
    at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2591)
    at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2466)
    at javafx.fxml/javafx.fxml.FXMLLoader.load(FXMLLoader.java:2435)
    at XR3Player/com.goxr3plus.xr3player.controllers.chromium.WebBrowserController.<init>(WebBrowserController.java:99)
    at XR3Player/com.goxr3plus.xr3player.application.MainLoader.lambda$startPart2$8(MainLoader.java:373)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:389)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
    at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
    at java.base/java.lang.Thread.run(Thread.java:835)

It says caused by :

Caused by: java.io.FileNotFoundException: chromium-win64.7z, chromium-win32.7z
    ... 44 more

where is this coming from ? My project is a Maven project and i have added all the needed dependencies and on the start of application i have added the license key and the directory i want to browser to have it's files :

static {

    // Chromium Extract Location Dir
    System.setProperty("jxbrowser.license.key", "license_key");
    System.setProperty("jxbrowser.chromium.dir",
        DatabaseTool.getAbsoluteDatabaseParentFolderPathWithSeparator() + "Chrome" + "7.0");
}

Enabling JxBrowser Logger :

01:19:49.837 DEBUG Verifying Chromium binaries...
01:19:49.838 DEBUG Verifying C:\Personal Projects\Github\XR3Player\target\classes\Chrome7.0\libEGL.dll...
01:19:49.838 DEBUG Verifying C:\Personal Projects\Github\XR3Player\target\classes\Chrome7.0\libEGL.dll... [FAIL] File does not exist
01:19:49.838 DEBUG Verifying C:\Personal Projects\Github\XR3Player\target\classes\Chrome7.0\libEGL.dll...
01:19:49.838 DEBUG Verifying C:\Personal Projects\Github\XR3Player\target\classes\Chrome7.0\libEGL.dll... [FAIL] File does not exist
01:19:49.839 DEBUG Verifying Chromium binaries... [FAIL]
01:19:49.839 DEBUG Finding Chromium binaries in JARs...
01:19:49.839 DEBUG Finding WIN_64...
01:19:49.840 DEBUG Finding WIN_64... [FAIL]
01:19:49.840 DEBUG Finding WIN_32...
01:19:49.840 DEBUG Finding WIN_32... [FAIL]

Maven Dependencies :

<!-- CHROMIUM BROWSER -->
<dependency>
    <groupId>com.teamdev.jxbrowser</groupId>
    <artifactId>jxbrowser-win64</artifactId>
    <version>7.0</version>
</dependency>

<dependency>
    <groupId>com.teamdev.jxbrowser</groupId>
    <artifactId>jxbrowser-javafx</artifactId>
    <version>7.0</version>
</dependency>
GOXR3PLUS
  • 6,877
  • 9
  • 44
  • 93

2 Answers2

1

I believe this happens when you set up the project in an IDE and add the jxbrowser dependencies as libraries. For me, intellij did not recognize the os specific chromium jar as a valid jar directory. It did not place this jar in the classpath. In my case, the resource not found was - jxbrowser-linux64-7.5.jar This jar contains - chromium-*.7z which is needed by jxbrowser. I extracted and unzipped this file to an accessible location. The location for the chromium installation should then be provided to the engine-

Engine engine = Engine.newInstance(
            EngineOptions.newBuilder(HARDWARE_ACCELERATED)  
                .chromiumDir(Paths.get("/home/rgupta/.jxbrowser/chromium/chromium-linux64"))
                    .build());

Then, jxbrowser started working.

Rohit Gupta
  • 33
  • 1
  • 6
0

I had the same bug when i added the OS specific jar in Intellij classpath. What i have done to fix it is to remove it and put it back again. Intellij don't recognize it and display a popup with options to select what kind of jar it is. then select classes.

Mustafa
  • 55
  • 5