Build the Android4.1 source code development environment in ubuntu

Source: Internet
Author: User

Android4.1 requires a 64-bit system to compile.


Summarize the experiences and problems, and share them with you:

1. You must install ubuntu12.04 amd64 on vm9.0. The hard disk space must be at least 50 GB.
Http://releases.ubuntu.com/12.04/

Bytes --------------------------------------------------------------------------------------------

2. Install JDK 6:
1. Before installing Sun's JDK, delete openjdk, open the new version, search for openjdk, and delete all packages.

2. download the latest Installation File (such as: http://www.oracle.com/technetwork/java/javase/downloads/jdk6-downloads-1637591.html) on Sun's official website ).

Add execution permission: sudo chmod U + x jdk-6u34-linux-x64.bin

Copy the installation file to the/usr/lib/Java/directory.

Run the installation command./jdk-6u34-linux-x64.bin

After successfully installing the JDK, We will configure the JDK and use the command $ sudo gedit/etc/environment to modify the environment file and add the following code:

Path = "/usr/lib/Java/jdk1.6.0 _ 34/bin"

Classpath = "/usr/lib/Java/jdk1.6.0 _ 34/lib"

JAVA_HOME = "/usr/lib/java/jdk1.6.0 _ 34"

If PATH already exists, use the colon as the interval to add the bin directory address of jdk, so that the java environment variable is configured successfully, however, the JDK used by default may not have been installed just now, Because ubuntu may also have a default jdk, such as openjdk; therefore, in order to make the jdk installed by default, you also need to execute the following command:

$ Sudo update-alternatives -- install/usr/bin/java/usr/lib/java/jdk1.6.0 _ 34/bin/java 300

$ Sudo update-alternatives -- install/usr/bin/javac/usr/lib/java/jdk1.6.0 _ 34/bin/javac 300

$ Sudo update-alternatives -- config java

After the command is successfully executed, the JDK we installed is the default one. You can run $ java-version to view the JDK information, for example:

Java version "1.6.0 _ 34"

Java (TM) SE Runtime Environment (build 1.6.0 _ 34-b04)
Java HotSpot (TM) 64-Bit Server VM (build 9-b04, mixed mode)

Bytes --------------------------------------------------------------------------------------------

3. Install required software packages
$ Sudo apt-get install git-core 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-dev: i386

$ Sudo ln-s/usr/lib/i386-linux-gnu/mesa/libGL. so.1/usr/lib/i386-linux-gnu/libGL. so

Bytes --------------------------------------------------------------------------------------------

4. Problem
1. If you cannot access ubuntu, click the circle on the right of the account on the logon page and select 2D logon.
2. If the installation software is slow and you need to modify the ubuntu source, google searches for ubuntu12.04 source and modifies it according to the method.
3. the ubuntu memory needs to be expanded to 2 GB when the framework is stuck in the compilation process.
4. gcc-eabi... and other errors may occur.

Check version
Gcc-v
G ++-v
If the version is earlier than 4.6, or the software package is missing, it must be installed to 4.6;

$ Sudo apt-get install gcc-4.6
$ Sudo apt-get install g ++-4.6

After installation, go to the/usr/bin directory.

$ Sudo mv gcc. bak

$ Sudo ln-s gcc-4.6 gcc

Similarly, make the same modification to g ++. After the modification is completed, check the gcc and g ++ versions:

Gcc-v
G ++-v

Gcc version 4.6.3 is displayed, indicating that gcc 4.6 is successfully installed.

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.