简体   繁体   English

如何将 Chromium Embedded Framework (CEF) 与 java 集成

[英]How to integrate Chromium Embedded Framework (CEF) with java

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).我已经尝试过JavaFx但我发现了一些问题,比如缺少对插件的支持(例如:flash、pdf 查看器等)。

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 ?经过大量搜索,我找到了 CEF 的 Chromium Embedded Framework (CEF) 或JCEF Java 包装器,但我不知道如何在 Java 中使用它来开始。有哪些依赖项?我如何使用netbeans开始开发 (POC)?

Is it possible to embed CEF/JCEF in java application?是否可以在 Java 应用程序中嵌入 CEF/JCEF?

Is it possible to embed CEF/JCEF in java application?是否可以在 Java 应用程序中嵌入 CEF/JCEF?

Yes, you can do that!是的,你可以这样做! The steps are:步骤是:

  1. Download JCEF and extract it JCEF下载 JCEF 并解压JCEF

  2. Declare Environment Variable to point to ${EXTRACT_DIR}/bin/lib/win64声明环境变量指向${EXTRACT_DIR}/bin/lib/win64

  3. 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} .在本地存储库中安装以下文件: ${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例如: mvn install:install-file -Dfile=gluegen-rt.jar -DgroupId=org.jcef -DartifactId=gluegen -Dversion=1.0 -Dpackaging=jar

  1. Create a maven project and declare installed artifacts in pom.xml创建一个 Maven 项目并在 pom.xml 中声明已安装的工件

  2. Copy sample: ${EXTRACT_DIR}/bin/tests/simple/MainFrame.java to your project and try it将示例: ${EXTRACT_DIR}/bin/tests/simple/MainFrame.java到您的项目中并尝试

Take note that those steps are for Maven Project and JVM 64bit请注意,这些步骤适用于Maven 项目JVM 64 位

I have a repository that maintains releases for each version of JCEF.我有一个存储库,用于维护 JCEF 的每个版本的发布。 The builds are done for different architectures and OS (mac, linux, and windows).构建是针对不同的体系结构和操作系统(mac、linux 和 windows)完成的。

https://github.com/jcefbuild/jcefbuild/releases 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.根据您的目标操作系统和架构,每个 zip 都包含需要放置在 Java 应用程序的类路径上的 jar。 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.它们还包含需要由您的应用程序加载的本地库,方法是将java.library.path设置为指向包含二进制文件的文件夹。

The zips also contain a test application which can be executed by running a script also found in the folder. zip 文件还包含一个测试应用程序,可以通过运行也在文件夹中找到的脚本来执行该应用程序。

I found an sample application of jcef. 我找到了jcef的示例应用程序。

To download this Sample Application Click Here 要下载此示例应用程序,请单击此处

You can embed CEF in Java applications by using the open source project Chromium SWT:您可以使用开源项目 Chromium SWT 在 Java 应用程序中嵌入 CEF:

https://github.com/equoplatform/chromium-swt https://github.com/equoplatform/chromium-swt

It works on SWT applications.它适用于 SWT 应用程序。 You can use it by adding an import sentence to your app and creating an instance of the Chromium widget.您可以通过向应用程序添加导入语句并创建Chromium小部件的实例来使用它。

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.由于您想使用 Java 创建桌面应用程序,我还建议您查看 Equo Framework,它允许从头开始创建桌面应用程序,使用 Java 和 HTML5 技术作为前端。 Please find the link below:请找到以下链接:

https://github.com/equoplatform/framework https://github.com/equoplatform/framework

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Java Chromium嵌入式框架(JCEF)保存mhtml - Java Chromium Embedded Framework (JCEF) save mhtml Java Chromium嵌入式框架(JCEF)对Chromium命令行的使用 - Java Chromium Embedded Framework (JCEF) usage of Chromium command lines 如何在MAC OS X中使用Java Chromium嵌入式框架创建Java项目? - How can i create Java project using Java Chromium Embedded Framework in MAC OS X? 征途浏览器 Java Chromium Embedded framework 抛出错误? - Journey browser Java Chromium Embedded framework throwing error? JCEF(Java Chromium嵌入式框架)应用程序中的屏幕未对齐 - Misaligned Screen in JCEF (Java Chromium Embedded Framework) Application JCEF(Java Chromium Embedded Framework)浏览器不加载内容; Eclipse 上只有黑屏 - JCEF (Java Chromium Embedded Framework) Browser does not load content; only blank screen on Eclipse JCEF 函数仅从第二次调用开始工作(Java Chromium Embedded Framework) - JCEF functions only work from the second call onwards (Java Chromium Embedded Framework) 使用Java在Eclipse中进行CEF开发 - CEF development in Eclipse with Java 如何使用Java将Docusign Embedded中占位符字段的拖放功能集成到我的Web应用程序中? - How to integrate the drag and drop feature of the placeholder fields in Docusign Embedded in my web application using Java? 如何将Angular 4与Vaadin框架集成 - How to integrate Angular 4 with Vaadin framework
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM