阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

Ubuntu 12.04搭建Android编译环境

186次阅读
没有评论

共计 2456 个字符,预计需要花费 7 分钟才能阅读完成。

Ubuntu 12.04 搭建 Android 编译环境

1:更新源

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

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

Ubuntu 官方更新服务器

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:安装 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)

android4.1 版需要安装(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 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

  本文永久更新链接地址 :http://www.linuxidc.com/Linux/2016-01/127172.htm

正文完
星哥玩云-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-21发表,共计2456字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中