ubuntu 15.10 上编译 android 4.4 编译环境搭建

主要是一些依赖包:

sudo apt-get install -y git-core gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev x11proto-core-dev libx11-dev libreadline6-dev libgl1-mesa-dev g++-multilib schedtool tofrodos python-markdown pngquant libxml2-utils xsltproc zlib1g-dev libxext-dev openjdk-7-jdk gettext bc mtools lib32z1 lib32ncurses5 python-pip libyaml-dev python-dev squashfs-tools
sudo pip install prettytable Mako pyaml dateutils --upgrade

还有JDK,不能用OPEN-JDK,而要用SUN/ORACLE的JDK:

http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html

4.4需要的是JDK6,下载Java SE Development Kit 6u45中的jdk-6u45-linux-x64.bin:

chmod +x jdk-6u45-linux-x64.bin

运行jdk-6u45-linux-x64.bin后,当前目录下会出现一个文件夹jdk1.6.0_45,将这个目录移动到特定目录,比如/opt

在/etc/profile中添加以下内容:

export JAVA_HOME=/opt/jdk1.6.0_45
export  PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib

source /etc/profile一下,然后安装jdk:

update-alternatives --install /usr/bin/java java /opt/jdk1.6.0_45/bin/java 1

update-alternatives --install /usr/bin/javac javac /opt/jdk1.6.0_45/bin/javac 1

update-alternatives --install /usr/bin/javaws javaws /opt/jdk1.6.0_45/bin/javaws 1

update-alternatives --install /usr/bin/jar jar /opt/jdk1.6.0_45/bin/jar 1

update-alternatives --install /usr/bin/javadoc javadoc /opt/jdk1.6.0_45/bin/javadoc 1

update-alternatives --install /usr/bin/javah javah /opt/jdk1.6.0_45/bin/javah 1


最后如果系统中不只一个JDK的话,设置默认:

update-alternatives --config java


参考链接:

http://blog.csdn.net/viekie/article/details/7903203

http://blog.sina.com.cn/s/blog_437ff56b0100tfi5.html

http://www.wikihow.com/Install-Oracle-Java-JDK-on-Ubuntu-Linux

你可能感兴趣的:(ubuntu 15.10 上编译 android 4.4 编译环境搭建)