ubuntu12.04搭建android编译环境

 

[置顶] 

分类: 环境搭建   306人阅读  评论(0)  收藏  举报

1:更新源 

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

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

# sohu (official China)
deb http://cn.archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ precise-proposed main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ precise-proposed main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse

 

 ③:sudo apt-get update


2:安装jdk

①:先下载相应的版本

http://www.oracle.com/technetwork/java/javase/downloads/index.html

jdk-6u31-linux-x64.bin

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

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

④: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

 ⑥将默认的jdk改过来

sudo update-alternatives --install /usr/bin/java java /usr/jdk1.6.0_31/bin/java 300

sudo update-alternatives --install /usr/bin/javac javac /usr/jdk1.6.0_31/bin/javac 300

sudo update-alternatives --config java

sudo update-alternatives --config javac

⑦:测试

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 20.6-b01, mixed mode)


3:库

sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib 
libc6-dev-i386 lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32z-dev

sudo apt-get install lib32readline-gplv2-dev

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

(sudo apt-get install uboot-mkimage)

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 gcc.bak

    sudo ln -s gcc-4.4 gcc

    ls -l g++*

    sudo mv g++ g++.bak

    sudo ln -s g++-4.4 g++

    gcc -v

    g++ -v

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值