JCEF Documentation

Java Chromium Embedded Framework documentation

View the Project on GitHub chromiumembedded/java-cef

This page lists notes for JCEF releases.

Contents


Background

The JCEF project is an extension of the Chromium Embedded Framework project hosted at https://github.com/chromiumembedded/cef. JCEF maintains a development branch that tracks the most recent CEF release branch. JCEF source code (both native code and Java code) can be built manually as described below.

Development

Ongoing development of JCEF occurs on the master branch. This location tracks the current CEF3 release branch.

Building from Source Code

Building JCEF from source code is currently supported on Windows, Linux and MacOS for 64-bit Oracle Java targets. 32-bit builds are also possible on Windows and Linux but they are untested.

To build JCEF from source code you should begin by installing the build prerequisites for your operating system and development environment. For all platforms this includes:

For Linux platforms:

For MacOS platforms:

For Windows platforms:

Building with Docker or GitHub Actions

For a quick and easy build setup, you can run your builds on Docker (Linux/Windows) or use GitHub Actions (with Docker). The jcefbuild repository on GitHub can be forked and used to compile your own custom sources, providing one-line build scripts for each platform, Docker environments for Linux and Windows, as well as GitHub Actions workflows for all platforms. It also adds support for more build architectures (arm64 + arm/v6 on Linux, arm64 on Windows). For more information, visit the repository readme file.

Building Manually

Building can also be performed as a series of manual steps.

Downloading Source Code

Download JCEF source code using Git.

# The JCEF source code will exist at `/path/to/java-cef/src`
cd /path/to/java-cef
git clone https://github.com/chromiumembedded/java-cef.git src

Building

1. Run CMake to generate platform-specific project files and then build the resulting native targets. See CMake output for any additional steps that may be necessary. For example, to generate a Release build of the jcef and jcef_helper targets:

# Enter the JCEF source code directory.
cd /path/to/java-cef/src

# Create and enter the `jcef_build` directory.
# The `jcef_build` directory name is required by other JCEF tooling
# and should not be changed.
mkdir jcef_build && cd jcef_build

# Linux: Generate 64-bit Unix Makefiles.
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
# Build using Make.
make -j4

# MacOS: Generate 64-bit Xcode project files.
cmake -G "Xcode" -DPROJECT_ARCH="x86_64" ..
# Open jcef.xcodeproj in Xcode
# - Select Scheme > Edit Scheme and change the "Build Configuration" to "Release"
# - Select Product > Build.

# MacOS: Generate ARM64 Xcode project files.
cmake -G "Xcode" -DPROJECT_ARCH="arm64" ..
# Open jcef.xcodeproj in Xcode
# - Select Scheme > Edit Scheme and change the "Build Configuration" to "Release"
# - Select Product > Build.

# Windows: Generate 64-bit VS2022 project files.
cmake -G "Visual Studio 17" -A x64 ..
# Open jcef.sln in Visual Studio
# - Select Build > Configuration Manager and change the "Active solution configuration" to "Release"
# - Select Build > Build Solution.

JCEF supports a number of different project formats via CMake including Ninja. See comments in the top-level CMakeLists.txt file for additional CMake usage instructions.

2. On Windows and Linux build the JCEF Java classes using the compile.[bat|sh] tool.

cd /path/to/java-cef/src/tools
compile.bat win64

On MacOS the JCEF Java classes are already built by the CMake project.

3. On Windows and Linux test that the resulting build works using the run.[bat|sh] tool. You can either run the simple example (see java/simple/MainFrame.java) or the detailed one (see java/detailed/MainFrame.java) by appending “detailed” or “simple” to the run.[bat|sh] tool. This example assumes that the “Release” configuration was built in step 1 and that you want to use the detailed example.

cd /path/to/java-cef/src/tools
run.bat win64 Release detailed

On MacOS run jcef_app for the detailed example. Either use the command-line or double-click on jcef_app in Finder.

cd /path/to/java-cef/src/jcef_build/native/Release
open jcef_app.app

Packaging

After building the Release configurations you can use the make_distrib.[bat|sh] script to create a binary distribution.

cd /path/to/java-cef/src/tools
make_distrib.bat win64

If the process succeeds a binary distribution package will be created in the /path/to/java-cef/src/binary_distrib directory. See the README.txt file in that directory for usage instructions.