Ubuntu12.04 build an Android compiling environment

Source: Internet
Author: User
Ubuntu12.04 build an Android compiling environment 1: update source ①: sudocp/etc/apt/sources. list/etc/apt/sources. list. bak ②: sudogedit/etc/apt/sources. listUbuntu official Update Server debhttp: // archive.ubuntu.com/ubuntu/quantalmainres

Build an Android compiling environment on Ubuntu 12.04

1: update source

①: Sudo cp/etc/apt/sources. list/etc/apt/sources. list. bak

②: Sudo gedit/etc/apt/sources. list

Ubuntu official Server Update

Deb http://archive.ubuntu.com/ubuntu/ quantal main restricted universe multiverse

Deb http://archive.ubuntu.com/ubuntu/ quantal-security main restricted universe multiverse

Deb http://archive.ubuntu.com/ubuntu/ quantal-updates main restricted universe multiverse

Deb http://archive.ubuntu.com/ubuntu/ quantal-proposed main restricted universe multiverse

Deb http://archive.ubuntu.com/ubuntu/ quantal-backports main restricted universe multiverse

Deb-src http://archive.ubuntu.com/ubuntu/ quantal main restricted universe multiverse

Deb-src http://archive.ubuntu.com/ubuntu/ quantal-security main restricted universe multiverse

Deb-src http://archive.ubuntu.com/ubuntu/ quantal-updates main restricted universe multiverse

Deb-src http://archive.ubuntu.com/ubuntu/ quantal-proposed main restricted universe multiverse

Deb-src http://archive.ubuntu.com/ubuntu/ quantal-backports main restricted universe multiverse

③: Sudo apt-get update

2: Install jdk

①: Download the corresponding version first

Http://www.Oracle.com/technetwork/java/javase/downloads/index.html

Jdk-6u31-linux-x64.bin

②: Sudocp jdk-6u31-linux-x64.bin/usr

(3) tony @ wgx:/usr $ sudo./jdk-6u31-linux-x64.bin

4. tony @ wgx :~ $ Sudo gedit/home/tony/. bashrc

⑤: Tony @ wgx :~ $ Sudo gedit/etc/profile

JAVA_HOME =/usr/jdk1.6.0 _ 31

JAVA_BIN =/usr/jdk1.6.0 _ 31/jre/bin

PATH = $ PATH: $ JAVA_HOME/bin

CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar

Export JAVA_HOME JAVA_BIN PATH CLASSPATH

6. Change the default jdk.

Sudo update-alternatives -- install/usr/bin/java/usr/jdk1.6.0 _ 31/bin/java 300

Sudo update-alternatives -- install/usr/bin/javac/usr/JDK 1.6.0 _ 31/bin/javac 300

Sudo update-alternatives -- config java

Sudo update-alternatives -- config javac

7. Test

Tony @ wgx :~ $ Echo $ JAVA_HOME

/Usr/jdk1.6.0 _ 31

Tony @ wgx :~ $ Java-version

Java version "1.6.0 _ 31"

Java (TM) SE Runtime Environment (build1.6.0 _ 31-b04)

JavaHotSpot (TM) 64-Bit Server VM (build ipv6-b01, mixed mode)

3: Database

Sudo apt-get install git-core gnupg flex bison gperf build-essentials zip curl zlib1g-dev gcc-multilib g ++-multilib

Libc6-dev-i386 lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev

Sudo apt-get install lib32readline-gplv2-dev

Sudo apt-get install g ++-4.4-multilib

(Sudo apt-get install uboot-mkimage)

Android4.1 requires installation (sudo apt-get install libxml2-utils)

4: gcc g ++

Sudo apt-get install gcc-4.4

Sudo apt-get install g ++-4.4

Cd/usr/bin

Ls-l gcc *

Sudo mv gcc. bak

Sudo ln-s gcc-4.4 gcc

Ls-l g ++ *

Sudo mv g ++. bak

Sudo ln-s g ++-4.4g ++

Gcc-v

G ++-v

 This article permanently updates the link address: Http://www.linuxidc.com/Linux/2016-01/127172.htm

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.