更改Android编译软件版本(make/gcc/bision)
一.make版本
1.下载make的压缩包
2.解压,安装
cd make-x.x
./configuration
sh build.sh
sudo make install
3.查看版本信息
make -v
二.gcc版本
1.使用命令安装gcc,以gcc-4.7为例,具体版本请自行决定
sudo apt-get install gcc-4.7 g++-4.7 g++-4.7-multilib gcc-4.7-multilib
2.若出现无法定位软件包,请添加源,并更新源
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
3.切换gcc版本,如从gcc4.7切换到gcc4.4
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.4
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7
update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.4
update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.7
也可以使用如下命令,根据需求去选择
sudo update-alternatives --config gcc
sudo update-alternatives --config g++
sudo update-alternatives --config cpp
4.查看版本信息
gcc -v
g++ -v
三.jdk版本
说明:Android4.x之前请使用jdk1.6,Android5.x请使用openjdk7
1.安装jdk,以jdk1.6.0_45为例
1.1 到官网选择具体的jdk版本下载:
http://www.oracle.com/technetwork/java/javase/archive-139210.html
1.2 复制到/usr/lib/jvm下
sudo cp jdk-6u45-linux-x64.bin /usr/lib/jvm
1.3 增加可执行权限
sudo chmod jdk-6u45-linux-x64.bin
1.4 解压
sudo ./jdk-6u45-linux-x64.bin
1.5 配置环境变量
sudo gedit /etc/environment
在最后添加如下信息,保存退出
export PATH=/usr/lib/jvm/jdk1.6.0_45/bin:$PATH
使用如下命令使环境变量生效
source /etc/environment
2.配置jdk,其中Android4.0不需要配置javap,而Android4.4以上版本需要配置
update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.6.0_45/bin/java"
update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_45/bin/javac"
update-alternatives --install "/usr/bin/javadoc" "javadoc" "/usr/lib/jvm/jdk1.6.0_45/bin/javadoc"
update-alternatives --install "/usr/lib/mozilla/plugins/libjavaplugin.so" "mozilla-javaplugin.so" "/usr/lib/jvm/jdk1.6.0_45/jre/lib/amd64/libnpjp2.so"
update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.6.0_45/bin/javaws"
update-alternatives --install "/usr/bin/javap" "javap" "/usr/lib/jvm/jdk1.6.0_45/bin/javap"
update-alternatives --install "/usr/bin/jar" "jar" "/usr/lib/jvm/jdk1.6.0_45/bin/jar"
3.更新jdk配置
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config javadoc
sudo update-alternatives --config mozilla-javaplugin.so
sudo update-alternatives --config javaws
sudo update-alternatives --config javap
sudo update-alternatives --config jar
4.查看版本信息
java -version
javac -version
四.bison版本
1.下载bison的压缩包
2.解压,安装
cd bison-x.x
./configure
make
sudo make install
Bison版本不对,可能会引发如下错误(以下错误基于Bison3.0.4与Bison3.0.2,Bison2.7.1不会报该错误
In file included from plural.y:::
plural-exp.h::: error: conflicting types for 'libintl_gettextparse'
# define PLURAL_PARSE libintl_gettextparse
^
plural.y::: note: in expansion of macro 'PLURAL_PARSE'
# define __gettextparse PLURAL_PARSE
^
plural.c::: note: in expansion of macro '__gettextparse'
int __gettextparse (void);
^
plural-exp.h::: note: previous declaration of 'libintl_gettextparse' was here
# define PLURAL_PARSE libintl_gettextparse
^
plural-exp.h::: note: in expansion of macro 'PLURAL_PARSE'
extern int PLURAL_PARSE (void *arg);
^
plural-exp.h::: error: conflicting types for 'libintl_gettextparse'
# define PLURAL_PARSE libintl_gettextparse
^
plural.y::: note: in expansion of macro 'PLURAL_PARSE'
# define __gettextparse PLURAL_PARSE
^
plural.c::: note: in expansion of macro '__gettextparse'
#define yyparse __gettextparse
^
plural.c::: note: in expansion of macro 'yyparse'
yyparse (void)
^
plural-exp.h::: note: previous declaration of 'libintl_gettextparse' was here
# define PLURAL_PARSE libintl_gettextparse
^
plural-exp.h::: note: in expansion of macro 'PLURAL_PARSE'
extern int PLURAL_PARSE (void *arg);
^
plural.c: In function 'libintl_gettextparse':
plural.c::: error: too few arguments to function '__gettextlex'
yychar = yylex (&yylval);
^
plural.c::: note: declared here
#define yylex __gettextlex
^
plural.y::: note: in expansion of macro 'yylex'
static int yylex (YYSTYPE *lval, const char **pexp);
^
plural.y::: error: 'arg' undeclared (first use in this function)
((struct parse_args *) arg)->res = $;
^
plural.y::: note: each undeclared identifier is reported only once for each function it appears in
Makefile:: recipe for target 'plural.o' failed
make[]: *** [plural.o] Error
更改Android编译软件版本(make/gcc/bision)的更多相关文章
- 编译lua版本问题
Compile++ thumb : game_shared <= main.cppjni/hellocpp/main.cpp: In function 'void Java_org_cocos ...
- linux 重新编译低版本gcc
编程实践中,可能会遇到需要较低版本gcc以兼容相应程序的需求,这时就需要我们将系统中默认的gcc版本较低,或者重新编译生成.(UBUNTU12.04下实现gcc4.2.3) 方法1: 对于UBUNTU ...
- android 检查软件是否有更新版本
import java.net.HttpURLConnection; import java.net.URL; import java.util.HashMap; import com.yuxin.m ...
- Android编译环境折腾记
题记:感觉是时候写点什么了=_=! 第一次安装了ubuntu14.04.5,官网下载的iso,官网下的jar,编译android4.x需要安装jdk6,更高的版本会有问题,baidu到很多搭建环境的步 ...
- Ubuntu 16.04下为Android编译OpenCV 3.2.0 Manager
http://johnhany.net/2016/07/build-opencv-manager-for-android-on-ubuntu/ 最近想在Android上尝试一下SIFT和SURF匹配算 ...
- Android编译过程详解(一)
Android编译过程详解(一) 注:本文转载自Android编译过程详解(一):http://www.cnblogs.com/mr-raptor/archive/2012/06/07/2540359 ...
- Android勒索软件研究报告
Android勒索软件研究报告 Author:360移动安全团队 0x00 摘要 手机勒索软件是一种通过锁住用户移动设备,使用户无法正常使用设备,并以此胁迫用户支付解锁费用的恶意软件.其表现为手机触摸 ...
- Android编译环境——ubuntu12.04上android2.3.4编译错误以及解决
Android编译环境——ubuntu12.04上android2.3.4编译错误以及解决 分类: android应用开发2013-08-21 09:20 4222人阅读 评论(3) 收藏 举报 li ...
- [转载]哪个版本的gcc才支持c11
转自:https://blog.csdn.net/haluoluo211/article/details/71141093 哪个版本的gcc才支持c11 2017年05月03日 19:25:43 Fi ...
随机推荐
- array_combine()
- 组织机构sql
with cte as ( select vcOrganID, vcParentID, vcOrganName, 0 as lvl from tbOrgan where vcOrgan ...
- Python2.7.9 编码问题
最近学一学网络爬虫,遇到第一件头疼的事情就是编码问题, 看了很多教程讲得不清楚, 现在整理一下,希望以后查看方便一些 使用 sys.getdefaultencoding() 查看Python的 ...
- mongodb学习-创建唯一索引(在已存在的集合创建)
如果在已存在的集合创建,可能会存在相同的值如下: 我们可以使用(2.x版本) db.users.ensureIndex({uid:1, name:1}, {unique:true, dropDups: ...
- phpstury 升级mysql5.7
今天在往本地导数据表的时候老是报错: [Err] 1294 - Invalid ON UPDATE clause for '字段名' column 报错的数据表字段: `字段名` datetime D ...
- git的使用和一些命令
1. https://github.com/ 在这个网站注册一个帐号. http://gitref.org/zh/creating/ 待会写.. [命令] a)
- Android 控件在布局中按比例放置[转]
转自:http://netsky1990.blog.51cto.com/2220666/997452 在Android开发中常用到线性布局LinearLayout对界面进行具体的创建,其中 ...
- Java概述、环境变量、注释、关键字、标识符、常量
Java语言的特点 有很多小特点,重点有两个开源,跨平台 Java语言是跨平台的 Java语言的平台 JavaSE JavaME--Android ...
- [转]一次Delete&Insert引发的Mysql死锁
近日遇到一个比较奇怪的deadlock错误, 错误详情: Deadlock found when trying to get lock; try restarting transaction; nes ...
- Spring MVC 基本配制
WEB.XML 文件中的配制: <?xml version="1.0" encoding="UTF-8"?> <web-app id=&quo ...