System environment
System: Ubuntu12.04 64-bit system.
Source: Android4.4 source code.
Choose Ubuntu12.04, is because in 14.04 failed to toss success, in the above compatible with 32-bit program configuration a little annoying. 12.04 must be used 64-bit, compile Android4.4 need 64-bit environment, and to be compatible with 32-bit programs, toss.
Steps
- Configure JDK6
Android's official step is to use the OPENJDK, the actual measurement is not possible. Find https://jdk6.java.net/download.html on the Web this URL has the required JDK, download the self-extracting installation package. After self-extracting, create a JDK directory in the current directory, open/etc/environment, and add your own JDK Bin directory into path. Also add the following environment variables:
Classpath=/path/to/your/local/jdk/dir/libjava_home=/path/to/your/local/jdk/dir
Then execute the following command to set the system's default JDK:
$ sudo update-alternatives--install/usr/bin/java java/usr/local/java/jdk1.6.0_38/bin/java 300$ sudo Update-alternatives--install/usr/bin/javac Javac/usr/local/java/jdk1.6.0_38/bin/javac 300$ sudo Update-alternatives--install/usr/bin/javaws javaws/usr/local/java/jdk1.6.0_38/bin/javaws 300$ sudo Update-alternatives--install/usr/bin/jar jar/usr/local/java/jdk1.6.0_38/bin/jar 300$ sudo update-alternatives-- INSTALL/USR/BIN/JAVAP javap/usr/local/java/jdk1.6.0_38/bin/javap 300$ sudo update-alternatives--config java
Install packages
Can be installed to install, so as not to compile the failure, but also back to re-install, as follows:
$ sudo apt-get install build-essential make gcc g++ libc6-dev texinfo libncurses-dev git-core GnuPG Flex Bison Zip Curl NC Urses-dev libsdl-dev Zlib1g-dev ia32-libs libxml2-utils Lzma
Compiling source code
To the source directory, as follows:
$ source Build/envsetup.sh
$ lunch
Select Arm platform.
$ make-jn
n is twice times the number of CPUs, mainly to improve the speed of the compilation.
Possible errors
The compilation process encountered the following error:
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__ errread, errwrite) file "/usr/lib/python2.7/ subprocess.py ", line 1259, in _execute_child raise child_exception oserror: [Errno 2] No such file or directory
The general situation is due to the fact that the previous JAVAP is not configured. If the necessary packages are not installed, there will be similar prompts, carefully look up the error prompt, find the real wrong place, install the corresponding package.
Reference
- Linux (ubuntu14.04) compiled Android4.4 source of the environment to build and compile the whole process
- Android 4.4 Code Resources 115 network disk download
Ubuntu12.04 System compiled Android4.4 source code