码迷,mamicode.com
首页 > 移动开发 > 详细

Ubuntu14.10上搭建Android应用开发环境和系统编译环境

时间:2015-06-16 06:48:45      阅读:174      评论:0      收藏:0      [点我收藏+]

标签:android

android应用开发环境搭建

  • Java JDK安装和配置.
  • Android NDK 下载安装配置.
  • Android ADT 下载安装配置.
  • Android SDK 下载.
  • Android Elicpse安装配置.
  • Android Studio 安装配置.

## Oracle JDK 下载安装配置 ##


Ubuntu14.10下安装JDK并配置多个版本切换

  • JDK1.6安装:
    使用update-alternatives工具来创建链接文件.
    sudo update-alternatives –install “/usr/bin/java” “java” “usr/lib/jvm/jdk6/jdk1.6.0_43/bin/java” 1
  • 其他同上.最后的结果如下.update-alternatives会创建如下两个链接文件如下:
zshh@HP:/usr/bin$ ls -l |grep ja
lrwxrwxrwx 1 root root         21 Dec  5  2014 jar -> /etc/alternatives/jar
lrwxrwxrwx 1 root root         22 Mar 30 09:59 java -> /etc/alternatives/java
lrwxrwxrwx 1 root root         23 Dec  5  2014 javac -> /etc/alternatives/javac
lrwxrwxrwx 1 root root         25 Dec  5  2014 javadoc -> /etc/alternatives/javadoc
lrwxrwxrwx 1 root root         23 Dec 22 17:04 javah -> /etc/alternatives/javah
lrwxrwxrwx 1 root root         23 Apr 29 07:20 javap -> /etc/alternatives/javap
lrwxrwxrwx 1 root root         24 Jun 16 00:35 javaws -> /etc/alternatives/javaws

zshh@HP:/etc/alternatives$ ls -l |grep java
lrwxrwxrwx 1 root root  38 Jun 16 00:31 jar -> /usr/lib/jvm/java6/jdk1.6.0_43/bin/jar
lrwxrwxrwx 1 root root  39 Jun 15 00:43 java -> /usr/lib/jvm/java6/jdk1.6.0_43/bin/java
lrwxrwxrwx 1 root root  40 Jun 15 23:54 javac -> /usr/lib/jvm/java6/jdk1.6.0_43/bin/javac
lrwxrwxrwx 1 root root  42 Jun 15 00:47 javadoc -> /usr/lib/jvm/java6/jdk1.6.0_43/bin/javadoc
lrwxrwxrwx 1 root root  40 Jun 15 00:48 javah -> /usr/lib/jvm/java6/jdk1.6.0_43/bin/javah
lrwxrwxrwx 1 root root  40 Jun 16 00:27 javap -> /usr/lib/jvm/java6/jdk1.6.0_43/bin/javap
lrwxrwxrwx 1 root root  41 Jun 16 00:38 javaws -> /usr/lib/jvm/java6/jdk1.6.0_43/bin/javaws

上面每个链接要确保正确,否则执行命令的时候提示没有安装这个软件.


JDK1.7安装: 安装过程和jdk完全一样.

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/java7/jdk1.7.0_80/bin/java" 2 
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/java7/jdk1.7.0_80/bin/javac" 2
sudo update-alternatives --install "/usr/bin/jar" "jar" "/usr/lib/jvm/java7/jdk1.7.0_80/bin/jar" 2
sudo update-alternatives --install "/usr/bin/javap" "javap" "/usr/lib/jvm/java7/jdk1.7.0_80/bin/javap" 2
sudo update-alternatives --install "/usr/bin/javadoc" "javadoc" "/usr/lib/jvm/java7/jdk1.7.0_80/bin/javadoc" 2
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/java7/jdk1.7.0_80/bin/javaws" 2

安装成功后文件如下:

zshh@HP:/usr/bin$ ls -l |grep ja
lrwxrwxrwx 1 root root         21 Dec  5  2014 jar -> /etc/alternatives/jar
lrwxrwxrwx 1 root root         22 Mar 30 09:59 java -> /etc/alternatives/java
lrwxrwxrwx 1 root root         23 Dec  5  2014 javac -> /etc/alternatives/javac
lrwxrwxrwx 1 root root         25 Dec  5  2014 javadoc -> /etc/alternatives/javadoc
lrwxrwxrwx 1 root root         23 Dec 22 17:04 javah -> /etc/alternatives/javah
lrwxrwxrwx 1 root root         23 Apr 29 07:20 javap -> /etc/alternatives/javap
lrwxrwxrwx 1 root root         24 Jun 16 00:35 javaws -> /etc/alternatives/javaws
zshh@HP:/etc/alternatives$ ls -l |grep java
lrwxrwxrwx 1 root root  38 Jun 16 00:54 jar -> /usr/lib/jvm/java7/jdk1.7.0_80/bin/jar
lrwxrwxrwx 1 root root  39 Jun 16 00:51 java -> /usr/lib/jvm/java7/jdk1.7.0_80/bin/java
lrwxrwxrwx 1 root root  40 Jun 16 00:47 javac -> /usr/lib/jvm/java7/jdk1.7.0_80/bin/javac
lrwxrwxrwx 1 root root  42 Jun 16 00:55 javadoc -> /usr/lib/jvm/java7/jdk1.7.0_80/bin/javadoc
lrwxrwxrwx 1 root root  40 Jun 15 00:48 javah -> /usr/lib/jvm/java6/jdk1.6.0_43/bin/javah
lrwxrwxrwx 1 root root  40 Jun 16 00:55 javap -> /usr/lib/jvm/java7/jdk1.7.0_80/bin/javap
lrwxrwxrwx 1 root root  41 Jun 16 00:56 javaws -> /usr/lib/jvm/java7/jdk1.7.0_80/bin/javaws

切换JDK版本

通过一下方法来
zshh@HP:~/Desktop/android-studio/bin$ sudo update-alternatives --config java
[sudo] password for zshh: 
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                     Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java7/jdk1.7.0_80/bin/java   2         auto mode
  1            /usr/lib/jvm/java6/jdk1.6.0_43/bin/java   1         manual mode
* 2            /usr/lib/jvm/java7/jdk1.7.0_80/bin/java   2         manual mode

Press enter to keep the current choice[*], or type selection number:

Ubuntu14.10上搭建Android应用开发环境和系统编译环境

标签:android

原文地址:http://blog.csdn.net/shaohuazuo/article/details/46495747

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!