JxBrowser library can be used in the headless Linux environments. To achieve that, the X-Server must be started.
In order to start X-Server, you need to perform the following actions:
1. Install Xvfb server in your headless Linux (e.g. Ubuntu Server 16.04.2 LTS):
sudo apt-get install xvfb
2. Start X-Server using the following command:
Xvfb :1 -screen 0 800x600x16
3. Run your Java application, e.g. packed in the jar file, using the xvfb-run command:
xvfb-run java -jar yourApplication.jar
What about the --headless command line flag?
Chromium 58 and higher supports the --headless command line flag (Linux-only) that allows you to run Chromium in Linux headless environment without starting X-Server. This flag is designed for the case when you just need to run Chromium in headless environment, load some URL, and attach to the loaded web page using DevTools via the --remote-debugging-port switcher. For example:
$ chrome --headless --remote-debugging-port=9222 https://chromium.org
Then, you load the localhost:9222 web page in a web browser application and work with the loaded web page using DevTools.