JCEF-win64编译(2)

如果需要自己编译JCEF,可参考以下文档。

https://bitbucket.org/chromiumembedded/java-cef/wiki/BranchesAndBuilding#markdown-header-building-from-source

虽然是英文的,但是并不难看懂,实在看不懂,在谷歌浏览器右键,选择“翻译成中文”

注意:最新的JCEF需要使用VS2019编译,文章中目前写的是VS2015,请参照JCEF项目中CMakeLists.txt中的注释进行编译,以免安装不必要的软件,浪费不必要的时间(我是踩了个大坑)

windows下编译需安装软件(请以自己的机机型号和最新的文档为准)【我的是Win10】

Cmake 最新版本(安装时可选择是否配置环境变量,也可手动在Path下加入Cmake的bin目录路径)

Git

JDK 1.7或1.8,我用的1.8。

Python 2.6+或3+

Visual studio 2019。安装跟C++开发有关的

PS:还得准备个VPN,Cmake编译时需要下载国外的资源。建议开个按量付费的云服务器编译,选择香港区域,流量选按使用流量付费,一小时几块钱(最新的版本我是在阿里云编译的)

软件装好了,一般不会有什么问题。用到的软件均可在此地址获取:百度网盘 请输入提取码  提取码:hfk2

1.在win10上,如果出现javac指令用不了,可以尝试配置java环境变量 Path 时用完整的路径

2.python安装好以后需要在环境变量 Path 配置安装路径

3.软件安装好后,在cmd命令行测试 python,cmake,javac 指令是否可用

在磁盘下新建一个jcef目录(名字随便取),使用cmd命令行进入此目录

下载jcef工程,建议用git

git clone https://bitbucket.org/chromiumembedded/java-cef.git src

项目下载完之后,进入src目录,打开CMakeLists.txt,把从message(STATUS "Downloading clang-format from Google Storage...")开始的这一块代码给注释了。clang-format这玩意不需要用到,下载很耗时间。

cmd命令行进入src目录

cd src

创建jcef_build目录,不要使用其他名字

mkdir jcef_build && cd jcef_build

执行cmake操作,可以使用Cmake bin目录下的 cmake-gui来操作,记得配置参数(注意,这里看CMakeLists.txt中怎么写的)

cmake -G "Visual Studio 16" -A x64 ..

cmake完成后,jcef_build目录下会生成vs项目。双击jcef.sln打开工程,设置为Release和x64,点击菜单项“生成”>“生成解决方案”,等待编译完成

cmd命令行进入src/tools目录下,执行命令

compile.bat win64

编译完成后,使用以下命令测试是否成功,出现浏览器窗口表示成功了。

run.bat win64 Release detailed

执行脚本,生成项目需要用到的文件,文件生成在 src\binary_distrib\win64\bin\lib 目录下

make_distrib.bat win64

岁在甲子,天下大吉!

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
CEF is a BSD-licensed open source project founded by Marshall Greenblatt in 2008 and based on the Google Chromium project. Unlike the Chromium project itself, which focuses mainly on Google Chrome application development, CEF focuses on facilitating embedded browser use cases in third-party applications. CEF insulates the user from the underlying Chromium and Blink code complexity by offering production-quality stable APIs, release branches tracking specific Chromium releases, and binary distributions. Most features in CEF have default implementations that provide rich functionality while requiring little or no integration work from the user. There are currently over 100 million installed instances of CEF around the world embedded in products from a wide range of companies and industries. A partial list of companies and products using CEF is available on the CEF Wikipedia page. Some use cases for CEF include: Embedding an HTML5-compliant Web browser control in an existing native application. Creating a light-weight native “shell” application that hosts a user interface developed primarily using Web technologies. Rendering Web content “off-screen” in applications that have their own custom drawing frameworks. Acting as a host for automated testing of existing Web properties and applications. CEF supports a wide range of programming languages and operating systems and can be easily integrated into both new and existing applications. It was designed from the ground up with both performance and ease of use in mind. The base framework includes C and C++ programming interfaces exposed via native libraries that insulate the host application from Chromium and Blink implementation details. It provides close integration between the browser and the host application including support for custom plugins, protocols, JavaScript objects and JavaScript extensions. The host application can optionally control resource loading, navigation, context menus, printing and more, while taking advantage of the same performance and HTML5 technologies available in the Google Chrome Web browser. This project provides a Java Wrapper for CEF (JCEF).
cmake-3.11.2-win64-x64 是一个用于 Windows 操作系统的 CMake 版本。CMake 是一个跨平台的开源构建工具,用于自动生成适用于不同的操作系统(例如 Windows、Linux 和 macOS)和编译器的构建文件。 cmake-3.11.2-win64-x64 意味着这是一个适用于 64 位 Windows 系统的 CMake 版本,可以用于开发和构建 64 位的 Windows 应用程序。CMake 提供了一种简化和标准化项目构建过程的方法,通过 CMake 脚本文件,可以描述项目的源代码、依赖项、编译选项等信息。 使用 cmake-3.11.2-win64-x64,您可以在 Windows 操作系统上进行项目的构建和编译。首先,您需要将 cmake-3.11.2-win64-x64 下载到本地计算机上,并按照安装指南进行安装。安装后,您可以在命令行中使用 cmake 命令或者使用图形界面工具(如 CMake-GUI)来配置项目的构建环境。 通过使用 CMake 构建项目,您可以轻松地生成适用于 Visual Studio、MinGW、Ninja 等常见编译器和构建工具的构建文件。通过执行生成的构建文件,您可以在本地计算机上编译和构建项目,生成可执行文件或者库文件。 总结来说,cmake-3.11.2-win64-x64 是一个适用于 64 位 Windows 系统的 CMake 版本,它提供了一种简化和标准化的项目构建过程,可以帮助开发者在 Windows 下进行项目的构建和编译。通过 CMake,您可以自动生成适用于不同平台和编译器的构建文件,从而提高项目的可移植性和可维护性。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值