andorid6编译必须要 openjdk7, 我机子上oracle jdk 8 不行
sudo apt-get install openjdk-7-jdk
查看openjdk的安装路径
sudo update-alternatives --config java
li@li-shuangbin:/vm/Android/android6_r1$ sudo update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-8-oracle/jre/bin/java 1073 auto mode
* 1 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1071 manual mode
2 /usr/lib/jvm/java-8-oracle/jre/bin/java 1073 manual mode
设置本shell的JAVA_HOME
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH
源码下载需要搭梯子,就不要问我了
导入编译Android源码所需的环境变量和其它参数:
source build/envsetup.sh
运行lunch命令选择编译目标:
lunch
开始编译
make -j8
显示
make_ext4fs -T -1 -S out/target/product/generic_x86_64/root/file_contexts -L system -l 1342177280 -a system out/target/product/generic_x86_64/obj/PACKAGING/systemimage_intermediates/system.img out/target/product/generic_x86_64/system out/target/product/generic_x86_64/system
Creating filesystem with parameters:
Size: 1342177280
Block size: 4096
Blocks per group: 32768
Inodes per group: 8192
Inode size: 256
Journal blocks: 5120
Label: system
Blocks: 327680
Block groups: 10
Reserved block group size: 79
Created filesystem with 1965/81920 inodes and 215486/327680 blocks
Install system fs image: out/target/product/generic_x86_64/system.img
out/target/product/generic_x86_64/system.img+ maxsize=1370278272 blocksize=2112 total=1342177280 reserve=13842048
表示编译成功
阅读(1648) | 评论(0) | 转发(0) |