一.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 100 update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7 50 update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 100 update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 50 update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.4 100 update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.7 50
也可以使用如下命令,根據需求去選擇
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 777 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" 1 update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_45/bin/javac" 1 update-alternatives --install "/usr/bin/javadoc" "javadoc" "/usr/lib/jvm/jdk1.6.0_45/bin/javadoc" 1 update-alternatives --install "/usr/lib/mozilla/plugins/libjavaplugin.so" "mozilla-javaplugin.so" "/usr/lib/jvm/jdk1.6.0_45/jre/lib/amd64/libnpjp2.so" 1 update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.6.0_45/bin/javaws" 1 update-alternatives --install "/usr/bin/javap" "javap" "/usr/lib/jvm/jdk1.6.0_45/bin/javap" 1 update-alternatives --install "/usr/bin/jar" "jar" "/usr/lib/jvm/jdk1.6.0_45/bin/jar" 1
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不會報該錯誤
1 In file included from plural.y:35:0: 2 plural-exp.h:94:23: error: conflicting types for 'libintl_gettextparse' 3 # define PLURAL_PARSE libintl_gettextparse 4 ^ 5 plural.y:40:25: note: in expansion of macro 'PLURAL_PARSE' 6 # define __gettextparse PLURAL_PARSE 7 ^ 8 plural.c:187:5: note: in expansion of macro '__gettextparse' 9 int __gettextparse (void); 10 ^ 11 plural-exp.h:94:23: note: previous declaration of 'libintl_gettextparse' was here 12 # define PLURAL_PARSE libintl_gettextparse 13 ^ 14 plural-exp.h:106:12: note: in expansion of macro 'PLURAL_PARSE' 15 extern int PLURAL_PARSE (void *arg); 16 ^ 17 plural-exp.h:94:23: error: conflicting types for 'libintl_gettextparse' 18 # define PLURAL_PARSE libintl_gettextparse 19 ^ 20 plural.y:40:25: note: in expansion of macro 'PLURAL_PARSE' 21 # define __gettextparse PLURAL_PARSE 22 ^ 23 plural.c:63:25: note: in expansion of macro '__gettextparse' 24 #define yyparse __gettextparse 25 ^ 26 plural.c:1108:1: note: in expansion of macro 'yyparse' 27 yyparse (void) 28 ^ 29 plural-exp.h:94:23: note: previous declaration of 'libintl_gettextparse' was here 30 # define PLURAL_PARSE libintl_gettextparse 31 ^ 32 plural-exp.h:106:12: note: in expansion of macro 'PLURAL_PARSE' 33 extern int PLURAL_PARSE (void *arg); 34 ^ 35 plural.c: In function 'libintl_gettextparse': 36 plural.c:1277:7: error: too few arguments to function '__gettextlex' 37 yychar = yylex (&yylval); 38 ^ 39 plural.c:64:25: note: declared here 40 #define yylex __gettextlex 41 ^ 42 plural.y:57:12: note: in expansion of macro 'yylex' 43 static int yylex (YYSTYPE *lval, const char **pexp); 44 ^ 45 plural.y:154:29: error: 'arg' undeclared (first use in this function) 46 ((struct parse_args *) arg)->res = $1; 47 ^ 48 plural.y:154:29: note: each undeclared identifier is reported only once for each function it appears in 49 Makefile:192: recipe for target 'plural.o' failed 50 make[3]: *** [plural.o] Error 1