Note: Advice in this article will only work for JxBrowser 6. See the corresponding article for JxBrowser 7 here.(注意:本文中的建议仅适用于JxBrowser6,JxBrowser7相应文章请点击这里。)

The jxbrowser-win32.jar, jxbrowser-win64.jar, jxbrowser-mac.jar, jxbrowser-linux64.jar libraries are part of JxBrowser library. They contain Chromium binaries for corresponding platform. At first run, JxBrowser extracts the binaries from appropriate JAR file into user’s temp directory on macOS and Linux, and AppData\Local\JxBrowser on Windows.(jxbrowser-win32.jar,jxbrowser-win64.jar,jxbrowser-mac.jar和jxbrowser-linux64.jar库是JxBrowser库的一部分。它们包含适用于相应平台的Chromium二进制文件。首次运行时,JxBrowser将相应的JAR文件中的二进制文件提取到macOS和Linux上用户的temp目录中,以及Windows上的AppData \ Local \ JxBrowser中。)

You can specify the directory path into which JxBrowser will extract Chromium binaries using the jxbrowser.chromium.dir system property. You can set the system property using the System.setProperty() method:(您可以使用jxbrowser.chromium.dir系统属性指定JxBrowser将Chromium二进制文件提取到的目录路径。您可以使用System.setProperty()方法设置系统属性:)

System.setProperty("jxbrowser.chromium.dir", "Users/Me/.jxbrowser");

Or through JVM parameter:(或通过JVM参数:)


Note: the property must be set before you create the first Browser instance in your application.(注意:必须先设置属性,然后才能在应用程序中创建第一个Browser实例。)

You can extract Chromium binaries from the jxbrowser-<platform>.jar JAR file manually and configure JxBrowser to use them via the jxbrowser.chromium.dir system property. This property must contain a valid absolute/relative path to the directory with extracted Chromium binaries.(您可以手动从jxbrowser- .jar JAR文件中提取Chromium二进制文件,并通过jxbrowser.chromium.dir系统属性将JxBrowser配置为使用它们。此属性必须包含具有提取的Chromium二进制文件的目录的有效绝对/相对路径。)

JxBrowser checks the directory and if the directory doesn't contain the required Chromium files, JxBrowser searches for the binaries inside JAR files included in the application class path and extract them programmatically.(JxBrowser检查目录,如果目录不包含必需的Chromium文件,则JxBrowser在应用程序类路径中包含的JAR文件中搜索二进制文件,并以编程方式提取它们。)

If JxBrowser cannot find Chromium binaries in the provided directory and none of the JAR files included into Java application class path contains Chromium binaries, an exception will be thrown during Browser instance initialization.(如果JxBrowser在提供的目录中找不到Chromium二进制文件,并且Java应用程序类路径中包含的JAR文件都不包含Chromium二进制文件,则在浏览器实例初始化期间将引发异常。)