博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
安装android studio for Ubuntu12.04.4-------(1)
阅读量:6422 次
发布时间:2019-06-23

本文共 3915 字,大约阅读时间需要 13 分钟。

hot3.png

1安装jdk8

joe@joe-Aspire-Z3730:~$ sudo add-apt-repository ppa:webupd8team/javaYou are about to add the following PPA to your system: Oracle Java (JDK) Installer (automatically downloads and installs Oracle JDK7 / JDK8 / JDK9). There are no actual Java files in this PPA.Important -> Why Oracle Java 7 And 6 Installers No Longer Work: http://www.webupd8.org/2017/06/why-oracle-java-7-and-6-installers-no.htmlUbuntu 16.10 Yakkety Yak is no longer supported by Canonical (and thus, Launchpad and this PPA). The PPA supports Ubuntu 17.10, 17.04, 16.04, 14.04 and 12.04.More info (and Ubuntu installation instructions):- for Oracle Java 7: http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html- for Oracle Java 8: http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.htmlDebian installation instructions:- Oracle Java 7: http://www.webupd8.org/2012/06/how-to-install-oracle-java-7-in-debian.html- Oracle Java 8: http://www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.htmlOracle Java 9 (for both Ubuntu and Debian): http://www.webupd8.org/2015/02/install-oracle-java-9-in-ubuntu-linux.htmlOracle JDK 9 is now considered stable. There are currently only 64bit builds (no other builds are available for download: http://www.oracle.com/technetwork/java/javase/downloads/index.html ) More info: https://launchpad.net/~webupd8team/+archive/ubuntu/javaPress [ENTER] to continue or ctrl-c to cancel adding itgpg: keyring `/tmp/tmp88YJjN/secring.gpg' createdgpg: keyring `/tmp/tmp88YJjN/pubring.gpg' createdgpg: requesting key EEA14886 from hkp server keyserver.ubuntu.comgpg: /tmp/tmp88YJjN/trustdb.gpg: trustdb createdgpg: key EEA14886: public key "Launchpad VLC" importedgpg: no ultimately trusted keys foundgpg: Total number processed: 1gpg:               imported: 1  (RSA: 1)OK

2: joe@joe-Aspire-Z3730:~$ sudo apt-get update

3:sudo apt-get install oracle-java8-installer 出现错误,没办法,只好参考 "Ubuntu 安装 JDK8 的两种方式()"中所说方法进行安装。后来太晚没有这样安装,第二天早上还是按步骤3直接安装成功了。

4:

joe@joe-Aspire-Z3730:~$ java -versionjava version "1.8.0_161"Java(TM) SE Runtime Environment (build 1.8.0_161-b12)Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)这说明原来的open jdk被替换了。如果要编译android源代码则可以通过下面的步骤5将jdk换回原来的版本。

5:

joe@joe-Aspire-Z3730:~$ update-java-alternatives -ljava-1.6.0-openjdk-amd64 1061 /usr/lib/jvm/java-1.6.0-openjdk-amd64java-1.7.0-openjdk-amd64 1051 /usr/lib/jvm/java-1.7.0-openjdk-amd64java-8-oracle 1081 /usr/lib/jvm/java-8-oraclejoe@joe-Aspire-Z3730:~$ echo $JAVA_HOME/usr/lib/jvm/java-7-openjdk-amd64/joe@joe-Aspire-Z3730:~$ update-java-alternatives -s java-1.7.0-openjdk-amd64update-java-alternatives: no root privilegesjoe@joe-Aspire-Z3730:~$ sudo update-java-alternatives -s java-1.7.0-openjdk-amd64joe@joe-Aspire-Z3730:~$ java -versionjava version "1.7.0_121"OpenJDK Runtime Environment (IcedTea 2.6.8) (7u121-2.6.8-1ubuntu0.12.04.3)OpenJDK 64-Bit Server VM (build 24.121-b00, mixed mode)joe@joe-Aspire-Z3730:~$ sudo update-java-alternatives -s java-8-oraclejoe@joe-Aspire-Z3730:~$ java -versionjava version "1.8.0_161"Java(TM) SE Runtime Environment (build 1.8.0_161-b12)Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)

6:下面的命令执行之后,感觉是不是也将JAVA_HOME环境变量改一改???(没试过,感觉最好也对应改一改)

joe@joe-Aspire-Z3730:~$ echo $JAVA_HOME/usr/lib/jvm/java-7-openjdk-amd64/joe@joe-Aspire-Z3730:~$ ls /usr/lib/jvmdefault-java              java-1.7.0-openjdk-amd64  java-6-openjdk-commonjava-1.6.0-openjdk        java-6-openjdk            java-7-openjdk-amd64java-1.6.0-openjdk-amd64  java-6-openjdk-amd64      java-8-oracle

7:

joe@joe-Aspire-Z3730:~$ gedit .profileJAVA_HOME=/usr/lib/jvm/java-8-oracle/  PATH=$PATH:$HOME/bin:$JAVA_HOME/bin CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tool.jar export JAVA_HOME  export PATHexport CLASSPATH

8:关闭终端再重启一个终端

joe@joe-Aspire-Z3730:~$ echo $JAVA_HOME/usr/lib/jvm/java-7-openjdk-amd64/

转载于:https://my.oschina.net/u/2963604/blog/1640337

你可能感兴趣的文章
Could not connect to '172.18.253.2' (port 22): Connection failed.
查看>>
通过F5 LTM iRule实现根据URL进行流量分发
查看>>
Day8-php 文件的操作
查看>>
Python的method, class method, static method
查看>>
自我介绍
查看>>
Linux命令 -- source(点命令)
查看>>
jvm重要参数分析
查看>>
Oracle10g下载地址--多平台下的32位和64位
查看>>
好的淘宝网站
查看>>
java操作数据库
查看>>
SQL CASE 多条件用法
查看>>
VOA 2009/11/02 DEVELOPMENT REPORT - In Kenya, a Better Life Through Mobile Money
查看>>
重学前端-CSS篇3-颜色、单位、字体、命名规范、书写顺序
查看>>
centos7防火墙常用命令
查看>>
rocketmq-producer
查看>>
throw语句的使用简介
查看>>
各种日期格式获取
查看>>
解决 LLVM 错误 fatal error: ‘csignal’ file not found
查看>>
freebase api的使用
查看>>
163网易yum源改编
查看>>