Application Class Path

In order to use JxBrowser library in your Java application you need to include all the JAR files from the lib directory of the JxBrowser distribution package into your application class path. Your application class path should look like: 

java -classpath jxbrowser.jar;jxbrowser-win32.jar;jxbrowser-win64.jar;jxbrowser-mac.jar;
jxbrowser-linux64.jar <your-application-class>

Note: If your application supports only Windows platform, there is no need to include the jxbrowser-mac.jar and jxbrowser-linux64.jar JAR files into your application class path.


The jxbrowser-win32.jar, jxbrowser-win64.jar, jxbrowser-mac.jar, jxbrowser-linux64.jar libraries contain Chromium binaries for corresponding platform. At the 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.


Maven

In order to obtain JxBrowser JAR files using Maven you need to add TeamDev's Maven repository to the repositories section of your pom.xml file: 

<repository>
    <id>com.teamdev</id>
    <url>http://maven.teamdev.com/repository/products</url>
</repository>

and configure the dependency section in your pom.xml file via Cross-platform or Platform Specific dependency: 


Cross-platform Dependency

Add the dependency on JxBrowser cross-platform library to the dependencies section of your pom.xml file:  

<dependency>
    <groupId>com.teamdev.jxbrowser</groupId>
    <artifactId>jxbrowser-cross-platform</artifactId>
    <version>6.21</version>
</dependency>

The jxbrowser-cross-platform artifact contains JxBrowser JAR files for cross-platform development. It includes JxBrowser JAR files for Windows, Linux, and macOS.


Platform Specific Dependency

If you need JxBrowser JAR files only for a specific platform, then you can use appropriate dependency as described below:


Windows 32-bit

<dependency>
    <groupId>com.teamdev.jxbrowser</groupId>
    <artifactId>jxbrowser-win32</artifactId>
    <version>6.21</version>
</dependency>

Windows 64-bit

<dependency>
    <groupId>com.teamdev.jxbrowser</groupId>
    <artifactId>jxbrowser-win64</artifactId>
    <version>6.21</version>
</dependency>

Note: if you don't know whether Windows 32-bit or 64-bit should be used in your project, then please check the article.


macOS

<dependency>
    <groupId>com.teamdev.jxbrowser</groupId>
    <artifactId>jxbrowser-mac</artifactId>
    <version>6.21</version>
</dependency>

Linux 64-bit 

<dependency>
    <groupId>com.teamdev.jxbrowser</groupId>
    <artifactId>jxbrowser-linux64</artifactId>
    <version>6.21</version>
</dependency>

 

Note: If your Java application runs only on Windows and macOS platforms, and you don't need Linux dependencies, then you can include into your pom.xml file only Windows and macOS dependencies.