three. Ubuntu System Android Build environment configuration
3.1 Select the installation Source:
After the system installation is complete, the software update source is selected first when entering the system, and all subsequent package installations are taken from this update source.
Select path: System Settings--Software & Updates--Ubuntu software---Download from--and other
In principle, use a server that is closer to your location. For example: China can choose Http://mirrors.163.com/ubuntu
To successfully avoid an update package exception for the compilation, I chose to: US update server:
3.2 Installing JDK1.6.0
- Compile Android4.1 required JDK6 ( system comes with OPENSDK, although Google Official document is said to use OPENSDK, but do not use this, or compile will be problematic )
- : (choose Linux x64) http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html
- I downloaded: jdk-6u45-linux-x64.bin
- Move the installation file to/USR/LIB/JVM below, if there is no JVM this directory will manually create a
- Modify file Permissions:
$chmod777 Jdk-6u45-linux-x64.bin
- Perform installation: $sudo./jdk-6u33-linux-x64.bin
$sudo ./jdk-6u33-linux-x64.bin
3.3 Configuring the JDK
- Open environment variable file
$sudo gedit/etc/enviroment
- Add the following environment variables to save and exit:
1 path=$PATH: $JAVA _home/bin2 classpath= ".: $JAVA _home/bin"3 java_home= "/usr/ Lib/jvm/jdk1.6.0_45 "
$sudoUpdate-alternatives--Install/usr/bin/java JAVA/USR/LIB/JVM/JAVA1.6.0_45/bin/java -$sudoUpdate-alternatives--Install/usr/bin/javac JAVAC/USR/LIB/JVM/JAVA1.6.0_45/bin/javac -$sudoUpdate-alternatives--Install/usr/bin/jar JAR/USR/LIB/JVM/JAVA1.6.0_45/bin/jar -$sudoUpdate-alternatives--config java$sudoUpdate-alternatives--config javac$sudoUpdate-alternatives--config Jar
- Verifying JDK Installation
Execution: $java –version
3.4 Install the necessary compilation packages for Android:
- Ubuntu version is 12.04, then execute:
sudo install git gnupg Flex bison gperf build-essential zip curl Libc6-dev Libncurses5-dev: i386 x11proto-core-Dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 LIBGL1 -mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc zlib1g- sudo Ln -s/usr/lib/i386-linux-gnu/mesa/libgl.so. 1 /usr/lib/i386-linux-gnu/libgl.so
- Ubuntu version is 14.04, then execute:
sudo install bison g++-multilib git gperf libxml2-utils
The following article:"Android Introduction and source code compilation---Android source code download"
Android Introduction and source code compilation---Ubuntu system Android Build Environment configuration