相关文章推荐
机灵的牛肉面  ·  示例 ...·  6 月前    · 
率性的啤酒  ·  亚马逊VaSCL | ...·  2 年前    · 
行走的猴子  ·  golang mysql timestamp-掘金·  2 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

com.teamdev.jxbrowser.internal.ChromiumExtractorException: Failed to extract Chromium binaries into x folder

Ask Question

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");
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]
    <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>

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.

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.