问题
I'd like to make a desktop application to let a website be browsed, I don't want to make a browser but a Browser embeded Application. I've tried with JavaFx
but I've found some problems like missing support for plugins (eg: flash, pdf viewer, etc).
After lots of search i found Chromium Embedded Framework (CEF) or JCEF Java wrapper for CEF but i don't know how to use it in java to start with.What are the dependencies?How i can start development (POC) using netbeans
?
Is it possible to embed CEF/JCEF in java application?
回答1:
Is it possible to embed CEF/JCEF in java application?
Yes, you can do that!
Please following these steps:
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}
.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
回答2:
I found an sample application of jcef.
To download this Sample Application Click Here
回答3:
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/smac89/java-cef-build/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.
来源:https://stackoverflow.com/questions/21192279/how-to-integrate-chromium-embedded-framework-cef-with-java