标签:android
## Oracle JDK 下载安装配置 ##
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
上面每个链接要确保正确,否则执行命令的时候提示没有安装这个软件.
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
通过一下方法来
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: 1
Ubuntu14.10上搭建Android应用开发环境和系统编译环境
标签:android
原文地址:http://blog.csdn.net/shaohuazuo/article/details/46495747