我电脑的环境是Ubuntu 12.04 64位。
Android Studio下载地址:
看下各个环境的说明
下面开始安装
Ctrl+Alt+T打开terminal,进行解压:
tar xzvf ~/Downloads/android-studio-bundle-130.677228-linux.tgzsudo mv android-studio /opt/
然后开始安装:
cd android-studio/bin/ ./studio.sh
可能会跑出来这句话:
OpenJDK Runtime Environment (IcedTea6 1.11.1) (6b24-1.11.1-4ubuntu2) OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode) OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode) WARNING: You are launching the IDE using OpenJDK Java runtime. ITS KNOWN TO HAVE PERFORMANCE AND GRAPHICS ISSUES! SWITCH TO THE ORACLE(SUN) JDK BEFORE REPORTING PROBLEMS! NOTE: If you have both Oracle (Sun) JDK and OpenJDK installed please validate either STUDIO_JDK, JDK_HOME, or JAVA_HOME environment variable points to valid Oracle (Sun) JDK installation. See http://ow.ly/6TuKQ for more info on switching default JDK.Press Enter to continue.
我电脑上装得是Ubuntu自带的OpenJDK,可能会出现一些错误或者警告什么的,于是我重新装了一遍JDK。
到
下载JDK,我下的是最新版的jdk-7u21-linux-x64.tar.gz(64位),建议下载1.6版本的,最新的不怎么稳定。网上有很多安装的方法(比如,,, )然后解压、配置环境变量:
tar xzvf ~/Downloads/jdk-7u21-linux-x64.tar.gzsudo mv jdk1.7.0_21/ /usr/lib/jvm/sudo vi /etc/environmentPATH="......:/usr/lib/jvm/jdk1.7.0_21:/opt/android-studio/bin/" CLASSPATH=.:/usr/lib/jvm/jdk1.7.0_21 JAVA_HOME=/usr/lib/jvm/jdk1.7.0_21 source ~/.bashrcsudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0_21/bin/java 300 sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.7.0_21/bin/javac 300 sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.7.0_21/bin/javaws 300 sudo update-alternatives --config javasudo update-alternatives --config javaws
用java -version测试下安装是否成功:
java -version java version "1.7.0_21" Java(TM) SE Runtime Environment (build 1.7.0_21-b11) Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)
如果你装的是64位的Ubuntu还要继续输入:
apt-get install lib32ncurses5 ia32-libs
最后再重新试一遍:
studio.sh
OK,成功!
熟悉下流程:
原文地址: