Dependent software Reference
This article refers to the JCEF compilation process on the official website
The successful compilation environment is as follows:
- Windows ten Bit
- JDK 1.8.0_121-bit
- Python 2.7.13
- git version 2.12.1.windows.1
- CMake version 3.12.0-rc1
- Visual Studio Enterprise Edition
The above software is also installed on the official web site software, but the version slightly different, official web version requirements are as follows:
- CMake version 2.8.12.2 or newer.
- Git.
- Java version 1.7 or 1.8.
- Python version 2.6 or newer in the 2.x series (3.x was not supported)
VS official is recommended to use version 2015.
In addition to the 64-bit machine compiled, the JDK is best to install 64-bit, because 64-bit machine default compilation 64-bit dependency, so the 32-bit JDK found the dependency will be error, will refer to after the error processing
download JCEF Source code
[Email protected] MINGW64 ~/d/learn/jecf/? [ Email protected]-8K18HPL mingw64/d/learn/jecf$ git clone https://bitbucket.org/ Chromiumembedded/java-cef.git srccloning into ' src '3710100% (1758/17583710 (delta 2461), reused 2576 (Delta 1682100% (3710/3710), 27.49 MiB | 68.00 kib/100% (2461/2461), done.? [Email protected] -8K18HPL mingw64/d/learn/jecf$
Execute make
At this point, although you can execute make, the make process has a problem making is required to download from Google Storage Clang-format, this step to execute once, the domestic user needs to set up the agent can, or will stay in -- Downloading clang-format from Google Storage...
this step output as follows:
--Found Pythoninterp:d:/python27/python.exe (Found version "2.7.13")--Found jni:c:/jdk1.8.0_121_x86/lib/ Jawt.lib (Required is at least version "1.7")native/native/jcef_version.h are Already up to date. --Downloading Clang-format from Google Storage ...
Before executing make, set the CMD proxy:
Set Http_proxy=http://{ip}:{port}set Https_proxy=http://{ip}:{port}
Perform make and refer to the make process commands provided on the website below
# 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 being Changed.mkdir jcef_build&&CD jcef_build?# linux:generate64-bit Unix makefiles.cmake-G "Unix makefiles"-dcmake_build_type=Release: # Build using Make.make-j4?# Mac OS x:generate64-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.? # windows:generate64-bit VS2015 Project Files.cmake-G "Visual Studio Win64" .. # 32bit # CMake-G "Visual Studio 14" .. # Open Jcef.sln in Visual studio#-Select Build > Configuration Manager and change the ' Active solution configuration ' to ' Release '# -Select Build > Build Solution.
If there is a JDK dependency error in this step, usually when using the Jdk,make on the machine using the
--Java directory: c:/jdk1.8.0_121_x86--JNI libraries: c:/jdk1.8.0_121_x86/lib/jawt.lib; c:/jdk1.8.0_121_x86/lib/jvm.lib--JNI include directories: c:/jdk1.8.0_121_x86/include; C:/jdk1.8.0_121_x86/include/win32; c:/jdk1.8.0_121_x86/include--Configuring done--Generating Done
As you can see from the above output, Java directory and JNI libraries Select the path to the 32-bit JDK, reinstall the JDK and configure the "#" JDK into the environment variable, delete all the files in the JCEF build, and re-execute the make step.
After execution is completed, enter the following:
-- configuringDone-- generatingdone--Build files with been written To:d:/learn/jecf/src/jcef_build
compiling a CEF-dependent DLL
Since JCEF is a Java-to-CEF package, it still requires CEF-dependent, CEF, and associated bridge compilation to be done using vs.
Go to Jcef_build directory and open Jcef.sln
The project configuration of the solution is changed from debug to release, then directly generated, and after production is successful, the output is as follows:
5>------Skipped Build: Project: all_build, config: Debug x64------5>========== Build: Success 4, failed 0, latest 0, skip 1 ==========
compiling Java code
Performcompile.bat win64
A-bit executioncompile.bat win32
D:\learn\jecf\src\tools>Compile.bat win64d:\learn\jecf\src\java\tests\detailed\handler\binding_test.html-d:\learn\jecf\src\out\win64\tests\detailed\handler\binding_test.htmld:\learn\jecf\src\java\tests\detailed\ Handler\binding_test2.html-d:\learn\jecf\src\out\win64\tests\detailed\handler\binding_test2.htmld:\learn\jecf\src\java\tests\detailed \handler\localstorage.html-d:\learn\jecf\src\out\win64\tests\detailed\handler\localstorage.htmld:\learn\jecf\src\java\tests\detailed\ Handler\spellcheck.html-d:\learn\jecf\src\out\win64\tests\detailed\handler\spellcheck.htmld:\learn\jecf\src\java\tests\detailed\ Handler\transparency.html-D:\learn\jecf\src\out\win64\tests\detailed\handler\transparency.html copied the5Files D:\learn\jecf\src\java\tests\detailed\handler\logo.png-D:\learn\jecf\src\out\win64\tests\detailed\handler\logo.png copied the1a file? D:\learn\jecf\src\tools>run.bat Win64 Release detailederror:native build output path does not exist? D:\learn\jecf\src\tools>
post-compilation tests
Performrun.bat win64 Release detailed
A-bit executionrun.bat win32 Release detailed
Get a Java app with a browser-embedded AWT interface, and in the Address bar https://html5test.com/
, you can see that the score is basically the same as the installed Chrome
If the VS does not modify the project configuration to release, the execution time to report the release path is not found
post-compilation distribution
Performmake_distrib.bat win64
A-bit executionmake_distrib.bat win32
d:\learn\jecf\src\tools>make_distrib.bat win64error:native Release build output path does not exist
If the VS does not modify the project configuration to release, the same execution time to the release path is not found
Post-distribution testing
If the execution succeeds, a Binary_distrib folder will be added to the SRC directory, which is the packaged and distributed file.
Enter Binary_distrib to execute Run.bat and run the application consistent with the compiled test;
At this point, the process of compiling JCEF ends
Windows compiler JCEF