Each JxBrowser version is compatible only with the same version of the binaries. For example, JxBrowser
8.2.0.1 will not work with the binaries from JxBrowser 8.2.0.
To make sure that the Chromium binaries are compatible with the current JxBrowser version, the library verifies
the binaries.
Extraction
By default, JxBrowser extracts binaries from a corresponding JAR file when
Engine
is first created. If you need
to extract binaries earlier, use this code:
Java
Kotlin
// Use the default directory.
ChromiumBinaries.deliverToDefaultDirectory();// Or use an arbitrary directory.
ChromiumBinaries.deliverTo(Paths.get("/path/to/binaries"));
// Use the default directory.
ChromiumBinaries.deliverToDefaultDirectory()// Or use an arbitrary directory.
ChromiumBinaries.deliverTo(Path("/path/to/binaries"))
If the compatible binaries are already extracted, JxBrowser will not extract them again. Otherwise, JxBrowser will
extract the binaries again and override the existing files.
Custom delivery
Starting with JxBrowser 7.35, developers can get the full control of delivering Chromium binaries to the environment.
This capability is intended for advanced use cases, such as downloading binaries from the network, or using a custom
compression algorithm.
To customize the delivery, implement
BinariesDelivery
interface and deliver the binaries when you need them:
Java
Kotlin
classTuneBinaryDeliveryimplementsBinariesDelivery{publicvoiddeliverTo(PathchromiumDir){// Pseudocode:
// Path downloadedArchive = SharedNetworkDrive.download("jxbrowser-win64.gz");
// Gzip.extract(downloadedArchive, chromiumDir);
// Use the default directory.
ChromiumBinaries.deliverToDefaultDirectory(newTuneBinaryDelivery());// Or use an arbitrary directory.
ChromiumBinaries.deliverTo(chromiumDir,newTuneBinaryDelivery());
classTuneBinaryDelivery:BinariesDelivery{overridefundeliverTo(chromiumDir:Path){// Pseudocode:
// Path downloadedArchive = SharedNetworkDrive.download("jxbrowser-win64.gz");
// Gzip.extract(downloadedArchive, chromiumDir);
// Use the default directory.
ChromiumBinaries.deliverToDefaultDirectory(TuneBinaryDelivery())// Or use an arbitrary directory.
ChromiumBinaries.deliverTo(chromiumDir,TuneBinaryDelivery())
If the compatible binaries are already extracted, JxBrowser will not call the custom delivery.
Sandbox
Windows
JxBrowser supports Chromium Sandbox on Windows. Sandbox is enabled by default, but you can disable it via the
appropriate
Engine
option: