How to integrate Chromium Embedded Framework (CEF) with java
I have a repository that maintains releases for each version of JCEF. The builds are done for different architectures and OS (mac, linux, and windows).
https://github.com/jcefbuild/jcefbuild/releases
Depending on your target OS and architecture, each zip contains jars which need to be placed on the classpath of your java application. They also contain native libraries which need to be loaded by your application by setting java.library.path
to point to the folder containing the binaries.
The zips also contain a test application which can be executed by running a script also found in the folder.
You can embed CEF in Java applications by using the open source project Chromium SWT:
https://github.com/equoplatform/chromium-swt
It works on SWT applications. You can use it by adding an import sentence to your app and creating an instance of the Chromium
widget.
Since you want to create a desktop app using Java, I also recommend to take a look at Equo Framework, which allows to create desktop applications from scratch, using java and HTML5 technologies for the frontend. Please find the link below:
https://github.com/equoplatform/framework
Is it possible to embed CEF/JCEF in java application?
Yes, you can do that! The steps are:
Download JCEF and extract it JCEF
Declare Environment Variable to point to
${EXTRACT_DIR}/bin/lib/win64
Install following files in local repository:
${EXTRACT_DIR}/bin/{gluegen-rt.jar, gluegen-rt-natives-windows-amd64.jar, jogl-all.jar, jogl-all-natives-windows-amd64.jar, jcef.jar}
.
For example: mvn install:install-file -Dfile=gluegen-rt.jar -DgroupId=org.jcef -DartifactId=gluegen -Dversion=1.0 -Dpackaging=jar
Create a maven project and declare installed artifacts in pom.xml
Copy sample:
${EXTRACT_DIR}/bin/tests/simple/MainFrame.java
to your project and try it
Take note that those steps are for Maven Project and JVM 64bit