如何在ubuntu10.04环境下编译android
发布网友
发布时间:2022-10-08 01:45
我来回答
共1个回答
热心网友
时间:2023-09-24 06:05
安装JDK1.6,使用如下命令
sudo chmod u+x jdk-6u23-linux-x64.bin
sudo cp -a jdk-6u23-linux-x64.bin /opt
sudo /opt/jdk-6u23-linux-x64.bin
sudo rm -f /opt/jdk-6u23-linux-x64.bin
2
设置JDK环境变量,在HOME根目录下按键盘Crtr+H显示HOME目录下所有文件,打开.bashrc,在最后加入以下代码
#set java environment
export JAVA_HOME=/opt/jdk1.6.0_23
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JRE_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
3
测试JDK是否安装成功,使用命令java -version 如果显示
java version "1.6.0_23"
Java(TM) SE Runtime Environment (build 1.6.0_23-b02)
Java HotSpot(TM) Server VM (build 16.3-b01, mixed mode)
则JDK安装成功。
END
测试MTK android编译环境是否搭建成功
切换到MTK源码根目录下,使用命令./mk check-env,若显示如下信息则安装成功
**********checking Env************
Your building environment is OK
The detail information is in "checkenv.log"!
*************************************************
同时在MTK源码根目录下生成checkenv.log文件,打开文件,显示ubuntu10.04大部分自带工具都和MTK的推荐的一致,如下:
Build Environment Requirement
===================================================
* ********* Suggested OS and Tool Chain to install *********
*
* OS : Linux distribution Ubuntu 10.04
* Memory Size : 4G or above
* make : GNU Make 3.81 or 3.82
* perl : Version 5.10.X
* python : Version 2.6.X
* arm-linux-androideabi-gcc : Version 4.6.X
* gcc : Version 4.4.3
* jdk : Version 1.6.X
* bison : Version 2.4.X
* flex : Version 2.5.X
* gperf : Version 3.0.X
* mingw : Installed
* unix2dos/tofrodos : Installed
* **********************************************************
===================================================
Build Environment Check Result Report
*************************************************************
[OS]: Ubuntu 10.04.4 (64-bit) [OK]
[Physical Memory Size] : 4052924 K-Bytes [WARNING]
it's smaller than recommendation, may cause out-of-memory build error
[make]: 3.81 (64-bit) [OK]
[perl]: 5.10.1 (64-bit) [OK]
[python]: 2.6.5 (64-bit) [OK]
[arm-linux-androideabi-gcc]: 4.6. (64-bit) [OK]
[gcc]: 4.4.3 (64-bit) [OK]
[jdk]: 1.6.0_45 (64-bit) [OK]
[bison]: 2.4.1 (64-bit) [OK]
[flex]: 2.5.35 (64-bit) [OK]
[gperf]: 3.0.3 (64-bit) [OK]
[mingw]: Installed [OK]
[unix2dos/tofrodos]: Installed [OK]
*************************************************************
步骤阅读
3
也可以解决下这个问题
[Physical Memory Size] : 4052924 K-Bytes [WARNING]
it's smaller than recommendation, may cause out-of-memory build error
打开mediatek/build/tools/checkEnv.py
修改lowMen为0