ubuntu12.10 64位编译Android4.1
1、更新source.list源
gedit /etc/apt/source.list
#網易的源(163源,無論是不是教育網,速度都很快)
deb http://mirrors.163.com/ubuntu/ quantal main universe restricted multiverse
deb-src http://mirrors.163.com/ubuntu/ quantal main universe restricted multiverse
deb http://mirrors.163.com/ubuntu/ quantal-security universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ quantal-security universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ quantal-updates universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ quantal-proposed universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ quantal-proposed universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ quantal-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ quantal-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ quantal-updates universe main multiverse restricted
#臺灣源(臺灣的ubuntu 更新源還是很給力的)
deb http://tw.archive.ubuntu.com/ubuntu/ quantal main universe restricted multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu/ quantal main universe restricted multiverse
deb http://tw.archive.ubuntu.com/ubuntu/ quantal-security universe main multiverse restricted
deb-src http://tw.archive.ubuntu.com/ubuntu/ quantal-security universe main multiverse restricted
deb http://tw.archive.ubuntu.com/ubuntu/ quantal-updates universe main multiverse restricted
deb-src http://tw.archive.ubuntu.com/ubuntu/ quantal-updates universe main multiverse restricted
#mirror.lupaworld.com的源,速度很快
deb http://mirror.lupaworld.com/ubuntu/archive/ quantal main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/archive/ quantal-security main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/archive/ quantal-updates main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/archive/ quantal-backports main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/ubuntu-cn/ quantal main restricted universe multiverse
#ubuntu.cn99.com源(推薦):
deb http://ubuntu.cn99.com/ubuntu/ quantal main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ quantal-updates main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ quantal-security main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ quantal-backports main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu-cn/ quantal main restricted universe multiverse
sudo apt-get update
2、安裝JDK1.6
http://www.oracle.com/technetwork/java/javase/downloads/jdk6downloads-1902814.html
這里選擇的是jdk-6u43-linux-x64.bin
我將下載的jdk-6u43-linux-x64.bin文件置于/usr/lib/中。
然后修改bin文件權限,使其可執行,在shell中執行:
執行下面命令,將會出現字幕,持續按回車鍵,直至屏幕顯示要求輸入yes/no,此時輸入y回車,將會把jdk解壓到文件夾,得jdk1.6.0_43目錄。
[cpp] view plaincopy
下面進行配置,在environment中修改,
[cpp] view plaincopy
添加如下部分
[cpp] view plaincopy
CLASSPATH=.:/usr/lib/jdk1.6.0_43/lib ?
JAVA_HOME=/usr/lib/jdk1.6.0_43
或者直接在/etc/profile中添加:(推薦使用)
[cpp] view plaincopy
由于ubuntu中可能會有默認的jdk,如openjdk,所以,為了使默認使用的是我們安裝的jdk,還要進行如下工作。
通過這一步將我們安裝的jdk加入java選單,執行:
然后執行,通過這一步選擇系統默認的jdk:
[cpp] view plaincopy
這樣,再在shell中輸入,就會顯示系統使用的java是sun的java:
[cpp] view plaincopy
1)
toltech@toltech-Lenovo:/home/jb$ lunch rk30sdk-eng
/bin/bash: bison: 未找到命令
解決:sudo apt-get install bison
2)
toltech@toltech-Lenovo:/home/jb$make -j8
mkdir: 無法創建目錄"out": 權限不夠
解決:使用root用戶登錄
3)
/bin/bash: xsltproc: 未找到命令
解決:apt-get install xsltproc
4)
/bin/bash: flex: 未找到命令
解決:apt-get install flex
5)prebuilts/tools/gcc-sdk/gcc: 行 40: prebuilts/tools/gcc-sdk/../../gcc/linux-gcc命令為找到
解決: $?sudo apt-get install gcc-4.4 g++-4.4 which gcc cd /usr/bin/ rm gcc g++ ln -s gcc-4.4 gcc ln -s g++-4.4 g++ 6)
在編譯內核的時候,提示如下錯誤:
[plain] view plaincopyprint?解決辦法:只要安裝libncurses5-dev就夠了。 [html] view plaincopyprint?
7)
64位系統用32位的交叉工具鏈
PC:ubuntu12.10-64位
交叉工具鏈:mipsel-linux-gcc-32位
查看工具鏈版本的時候出現一下錯誤:
mipsel-linux-gcc -v
bash: ***/mipsel-linux-gcc : no such flie or directory
解決:
sudo apt-get install ia32-lib*
8)
/bin/sh: 1: uudecode: not found
解決:#sudo apt-get install sharutils
/usr/include/features.h:324:26: fatal error: bits/predefs.h: No such file or directory
解決:
apt-get install libc6-dev-i386
sudo apt-get install libxml2-utils xsltproc
總結
以上是生活随笔為你收集整理的ubuntu12.10 64位编译Android4.1的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: android4.0.3源码之鼠标光标绘
- 下一篇: Android4.1 触摸屏(TP)划线