"Turn" Linux (ubuntu14.04) compiled Android4.4 source of the environment to build and compile the whole process

Source: Internet
Author: User
Tags sublime text

Original URL: http://jileniao.net/linux-android-building.html

Sublime text makes me sad. Originally very trusting sublime text automatic saving function, before use has been very to force, but this time let me sad.

On the Linux (ubuntu14.04) compiled Android source of the environment to build the detailed process is in the sublime text editing good, helpless, this time the data loss so I have to recall the hand once again. May be a lot of details, this time to re-edit the article will not remember so clear, but also ask a friend of the question below the message to me just fine.

1. Download and install Jdk6
Note that the version must be JDK6 and the other versions will be problematic.
The methods of online circulation are mostly Apt-get install JDK installed, the actual operation proves that this is not possible, the following gives a download jdk6 address
Https://jdk6.java.net/download.html is here to choose the self-extracting file (self-extracting) according to the configuration of his machine.
Download the above to get the Jdk-6u38-ea-bin-b04-linux-i586-31_oct_2012.bin file, change the property to have executable permission.
./jdk-6u38-ea-bin-b04-linux-i586-31_oct_2012.bin can be installed

2.Linux Configuring the environment variables for the JDK
Execute command sudo gedit/etc/environment
Append yourself to the path of the environment variable file 1. The path to the JDK directory is noted in the Bin directory
Example:/usr/local/java/jdk1.6.0_38/bin
and add two environment variables classpath and Java_home
For example:
classpath=.:/ Usr/local/java/jdk1.6.0_38/lib
Java_home=/usr/local/java/jdk1.6.0_38

3. Update the environment variables to take effect
Execute command:
sudo source/home/yourloginname/.bashrc

4. Set the default JDK under Ubuntu
Because Ubnuntu has the default installation of OPENJDK, but we compile the Android source code is required jdk6, so you need to set the default to Jdk6
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
Update-alternatives--config Java

Select Jdk6 at this time

5. Test that the JDK environment variable is configured correctly
Java-version
If you can see the version number of your installed JDK6, the JDK environment variable has been configured successfully

6. Additional software to be installed in advance
Description, in order to ensure that the compilation process is not always missing some software and interrupted, so we must be ready to work, do not fight any unprepared war.
Many of the online predecessors have already given out a lot of software to be installed in advance, I put them together below.
sudo apt-get install build-essential
sudo apt-get install make
sudo apt-get install gcc
sudo apt-get install g++
sudo apt-get install Libc6-dev
sudo apt-get install patch
sudo apt-get install Texinfo
sudo apt-get install Libncurses-dev
sudo apt-get install Git-core GnuPG
sudo apt-get install Flex
sudo apt-get install Bison
sudo apt-get install Gperf
sudo apt-get install Libsdl-dev
sudo apt-get install Libesd0-dev
sudo apt-get install Libwxgtk2.6-dev
sudo apt-get install build-essential
sudo apt-get install zip
sudo apt-get Install Curl
sudo apt-get install Ncurses-dev
sudo apt-get install Zlib1g-dev
sudo apt-get install Valgrind
sudo apt-get install python2.5 (the software I did not install successfully, and finally did not have any problems)
sudo apt-get install libgtk2.0-0:i386
sudo apt-get install libpangox-1.0-0:i386
sudo apt-get install libpangoxft-1.0-0:i386
sudo apt-get install libidn11:i386
sudo apt-get install gstreamer0.10-pulseaudio:i386
sudo apt-get install gstreamer0.10-plugins-base:i386
sudo apt-get install gstreamer0.10-plugins-good:i386
sudo apt-get install gstreamer0.10-ffmpeg:i386 (the software I did not install successfully, and finally did not have any problems)

Add a note: The last few of the softwares above are i386 because of a bug (which is not really remembered at the moment), and the reason for the error is that you need to install the Ia32-libs package 64-bit Linux (Ubuntu) When compiling Android source code also need a 32-bit Linux package, so need this ia32-libs support package, but this ia32-libs package is not found on the Internet, nor found the actual solution available, but from the Ubuntu official website, This ia32-libs is actually a collection of several packages, so download and install a few of the packages can achieve our goal.

7. Formally compiling Android source code
Having done so much preparation, I can finally do the work now. According to the Android website, compiled Android source code to execute the following three commands can be
①source build/envsetup.sh
②lunch
To select a compilation platform at this time
③make-jn
Here the n attention to the value, the Internet is generally said to be twice times the number of CPU cores, there is a CPU core number plus 1. I didn't verify which one was more accurate.
However, it is worth reminding that, although N uses a large value to make the compilation faster, if n is too large, the compilation will be an error.
If you are not sure what value n should use, then use the Make command directly.

From the beginning of the compilation to the end of the compilation, this time is still very long, I was built on the virtual machine Ubuntu14.04, the allocation of memory is 2G, the direct use of Make command, the first compile, is from 9:30 to compile, 17:00 before the complete end of the compilation. If the machine is configured better, or if the actual machine is compiled with Ubuntu, it should take less time.


At this point, Linux (ubuntu14.04) compiled Android source of the environment to build and compile the entire process is over.
Finally, the command to install 7z software package on Ubuntu and how to use it
Installing 7z:apt-get Install P7zip-full
Use 7z:7z x file file is the filename to unzip

Copyright NOTICE: If no special note, this article is (Birds of Paradise) Original, reproduced please retain the source of the article.

"Turn" Linux (ubuntu14.04) compiled Android4.4 source of the environment to build and compile the whole process

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.